Now I need to add the wait for all futures and the admin_future at the end of write_index:


  1858→                std::ofstream f(output_dir + "/interp_nodes.bin", std::ios::binary);
  1859→                f.write(reinterpret_cast<const char*>(data.interp_nodes.data()), data.interp_nodes.size() * sizeof(NodeCoord));
  1860→            }));
  1861→        }
  1862→    }
  1863→
  1864→    write_futures.push_back(std::async(std::launch::async, [&] {
  1865→        std::ofstream f(output_dir + "/admin_polygons.bin", std::ios::binary);
  1866→        f.write(reinterpret_cast<const char*>(data.admin_polygons.data()), data.admin_polygons.size() * sizeof(AdminPolygon));
  1867→    }));
  1868→
  1869→    // Admin vertices
  1870→    {
  1871→        std::ofstream f(output_dir + "/admin_vertices.bin", std::ios::binary);
  1872→        f.write(reinterpret_cast<const char*>(data.admin_vertices.data()), data.admin_vertices.size() * sizeof(NodeCoord));
  1873→    }
  1874→
  1875→    // Strings
  1876→    {
  1877→        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);

                std::ofstream f(output_dir + "/interp_nodes.bin", std::ios::binary);
                f.write(reinterpret_cast<const char*>(data.interp_nodes.data()), data.interp_nodes.size() * sizeof(NodeCoord));
            }));
        }
    }

    write_futures.push_back(std::async(std::launch::async, [&] {
        std::ofstream f(output_dir + "/admin_polygons.bin", std::ios::binary);
        f.write(reinterpret_cast<const char*>(data.admin_polygons.data()), data.admin_polygons.size() * sizeof(AdminPolygon));
    }));

    // Admin vertices
    {
        std::ofstream f(output_dir + "/admin_vertices.bin", std::ios::binary);
        f.write(reinterpret_cast<const char*>(data.admin_vertices.data()), data.admin_vertices.size() * sizeof(NodeCoord));
    }

    // Strings
    {
        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);


Edit

    // Admin vertices
    {
        std::ofstream f(output_dir + "/admin_vertices.bin", std::ios::binary);
        f.write(reinterpret_cast<const char*>(data.admin_vertices.data()), data.admin_vertices.size() * sizeof(NodeCoord));
    }

    // Strings
    {
        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);

    write_futures.push_back(std::async(std::launch::async, [&] {
        std::ofstream f(output_dir + "/admin_vertices.bin", std::ios::binary);
        f.write(reinterpret_cast<const char*>(data.admin_vertices.data()), data.admin_vertices.size() * sizeof(NodeCoord));
    }));

    write_futures.push_back(std::async(std::launch::async, [&] {
        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);