diff --git a/include/osmium/area/problem_reporter_ogr.hpp b/include/osmium/area/problem_reporter_ogr.hpp index 47a1aef2..d4c6cfd7 100644 --- a/include/osmium/area/problem_reporter_ogr.hpp +++ b/include/osmium/area/problem_reporter_ogr.hpp @@ -89,7 +89,7 @@ namespace osmium { } void write_line(const char* problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location loc1, osmium::Location loc2) { - auto ogr_linestring = std::unique_ptr{new OGRLineString{}}; + auto ogr_linestring = std::make_unique(); ogr_linestring->addPoint(loc1.lon(), loc1.lat()); ogr_linestring->addPoint(loc2.lon(), loc2.lat()); diff --git a/include/osmium/geom/ogr.hpp b/include/osmium/geom/ogr.hpp index cd2327a9..3c7a4420 100644 --- a/include/osmium/geom/ogr.hpp +++ b/include/osmium/geom/ogr.hpp @@ -83,13 +83,13 @@ namespace osmium { /* Point */ static point_type make_point(const osmium::geom::Coordinates& xy) { - return point_type{new OGRPoint{xy.x, xy.y}}; + return std::make_unique(xy.x, xy.y); } /* LineString */ void linestring_start() { - m_linestring.reset(new OGRLineString{}); + m_linestring = std::make_unique(); } void linestring_add_location(const osmium::geom::Coordinates& xy) { @@ -105,7 +105,7 @@ namespace osmium { /* Polygon */ void polygon_start() { - m_ring.reset(new OGRLinearRing{}); + m_ring = std::make_unique(); } void polygon_add_location(const osmium::geom::Coordinates& xy) { @@ -114,7 +114,7 @@ namespace osmium { } polygon_type polygon_finish(size_t /* num_points */) { - auto polygon = std::unique_ptr{new OGRPolygon{}}; + auto polygon = std::make_unique(); polygon->addRingDirectly(m_ring.release()); return polygon; } @@ -122,11 +122,11 @@ namespace osmium { /* MultiPolygon */ void multipolygon_start() { - m_multipolygon.reset(new OGRMultiPolygon{}); + m_multipolygon = std::make_unique(); } void multipolygon_polygon_start() { - m_polygon.reset(new OGRPolygon{}); + m_polygon = std::make_unique(); } void multipolygon_polygon_finish() { @@ -136,7 +136,7 @@ namespace osmium { } void multipolygon_outer_ring_start() { - m_ring.reset(new OGRLinearRing{}); + m_ring = std::make_unique(); } void multipolygon_outer_ring_finish() { @@ -146,7 +146,7 @@ namespace osmium { } void multipolygon_inner_ring_start() { - m_ring.reset(new OGRLinearRing{}); + m_ring = std::make_unique(); } void multipolygon_inner_ring_finish() { diff --git a/include/osmium/io/detail/pbf_output_format.hpp b/include/osmium/io/detail/pbf_output_format.hpp index 670c29a8..9d8b0922 100644 --- a/include/osmium/io/detail/pbf_output_format.hpp +++ b/include/osmium/io/detail/pbf_output_format.hpp @@ -312,7 +312,7 @@ namespace osmium { void add_dense_node(const osmium::Node& node) { if (!m_dense_nodes) { - m_dense_nodes.reset(new DenseNodes{&m_stringtable, &m_options}); + m_dense_nodes = std::make_unique(&m_stringtable, &m_options); } m_dense_nodes->add_node(node); ++m_count; diff --git a/include/osmium/io/detail/xml_input_format.hpp b/include/osmium/io/detail/xml_input_format.hpp index e45267bd..35575e9e 100644 --- a/include/osmium/io/detail/xml_input_format.hpp +++ b/include/osmium/io/detail/xml_input_format.hpp @@ -338,7 +338,7 @@ namespace osmium { }); if (!m_tl_builder) { - m_tl_builder.reset(new osmium::builder::TagListBuilder{builder}); + m_tl_builder = std::make_unique(builder); } m_tl_builder->add_tag(k, v); } @@ -391,7 +391,7 @@ namespace osmium { mark_header_as_done(); if (read_types() & osmium::osm_entity_bits::node) { maybe_new_buffer(osmium::item_type::node); - m_node_builder.reset(new osmium::builder::NodeBuilder{buffer()}); + m_node_builder = std::make_unique(buffer()); m_node_builder->set_user(init_object(m_node_builder->object(), attrs)); } return; @@ -402,7 +402,7 @@ namespace osmium { mark_header_as_done(); if (read_types() & osmium::osm_entity_bits::way) { maybe_new_buffer(osmium::item_type::way); - m_way_builder.reset(new osmium::builder::WayBuilder{buffer()}); + m_way_builder = std::make_unique(buffer()); m_way_builder->set_user(init_object(m_way_builder->object(), attrs)); } return; @@ -413,7 +413,7 @@ namespace osmium { mark_header_as_done(); if (read_types() & osmium::osm_entity_bits::relation) { maybe_new_buffer(osmium::item_type::relation); - m_relation_builder.reset(new osmium::builder::RelationBuilder{buffer()}); + m_relation_builder = std::make_unique(buffer()); m_relation_builder->set_user(init_object(m_relation_builder->object(), attrs)); } return; @@ -428,7 +428,7 @@ namespace osmium { mark_header_as_done(); if (read_types() & osmium::osm_entity_bits::changeset) { maybe_new_buffer(osmium::item_type::changeset); - m_changeset_builder.reset(new osmium::builder::ChangesetBuilder{buffer()}); + m_changeset_builder = std::make_unique(buffer()); init_changeset(*m_changeset_builder, attrs); } } else if (!std::strcmp(element, "create")) { @@ -508,7 +508,7 @@ namespace osmium { m_tl_builder.reset(); if (!m_wnl_builder) { - m_wnl_builder.reset(new osmium::builder::WayNodeListBuilder{*m_way_builder}); + m_wnl_builder = std::make_unique(*m_way_builder); } NodeRef nr; @@ -542,7 +542,7 @@ namespace osmium { m_tl_builder.reset(); if (!m_rml_builder) { - m_rml_builder.reset(new osmium::builder::RelationMemberListBuilder{*m_relation_builder}); + m_rml_builder = std::make_unique(*m_relation_builder); } item_type type = item_type::undefined; @@ -591,7 +591,7 @@ namespace osmium { if (read_types() & osmium::osm_entity_bits::changeset) { m_tl_builder.reset(); if (!m_changeset_discussion_builder) { - m_changeset_discussion_builder.reset(new osmium::builder::ChangesetDiscussionBuilder{*m_changeset_builder}); + m_changeset_discussion_builder = std::make_unique(*m_changeset_builder); } } } else if (!std::strcmp(element, "tag")) {