Skip to content

Commit 01cffff

Browse files
remove std::format
1 parent 6b29202 commit 01cffff

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/extractor/area/area_mesher.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <osmium/osm/types.hpp>
2525

2626
#include <algorithm>
27-
#include <format>
2827
#include <iterator>
2928

3029
namespace osrm::extractor::area
@@ -62,8 +61,9 @@ void copy_tags(osmium::builder::Builder &parent, const osmium::TagList &tags)
6261
*/
6362
std::string area_id(const osmium::Area &area)
6463
{
65-
char type = area.id() % 2 == 1 ? 'r' : 'w';
66-
return std::format("{}{}", type, area.orig_id());
64+
std::stringstream strstream;
65+
strstream << (area.id() % 2 == 1 ? "r" : "w") << area.orig_id();
66+
return strstream.str();
6767
}
6868

6969
} // namespace
@@ -302,11 +302,12 @@ void AreaMesher::mesh_area(const osmium::Area &area,
302302
out_buffer.commit();
303303
};
304304

305-
const auto write_debug = [&](const char *filename, const std::set<OsmiumSegment> &segments)
305+
const auto write_debug = [&](const char *basename, const std::set<OsmiumSegment> &segments)
306306
{
307307
// write debug file
308-
std::filesystem::path path = std::filesystem::temp_directory_path() /
309-
std::format("{}-{}.osm", filename, area_id(area));
308+
std::stringstream strstream;
309+
strstream << basename << "-" << area_id(area) << ".osm";
310+
std::filesystem::path path = std::filesystem::temp_directory_path() / strstream.str();
310311
osmium::io::Writer writer(path, osmium::io::overwrite::allow);
311312
osmium::memory::Buffer debug_buffer{16 * 1024};
312313
add_to_buffer(segments, debug_buffer);

0 commit comments

Comments
 (0)