From 72e0889000978913f6a686c9bc3a830e6b91c592 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 10 Jul 2014 12:28:52 +0100 Subject: [PATCH] replace auto_ptr with unique_ptr (creeped in from 2.3.x) --- src/wkb.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wkb.cpp b/src/wkb.cpp index 107a820f7..391e75c64 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -344,10 +344,10 @@ private: { double x = read_double(); double y = read_double(); - std::auto_ptr pt(new geometry_type(geometry_type::types::Point)); + auto pt = std::make_unique(geometry_type::types::Point); pos_ += 16; pt->move_to(x, y); - paths.push_back(pt); + paths.push_back(pt.release()); } void read_multipoint_xyz(boost::ptr_vector & paths) @@ -421,13 +421,13 @@ private: { CoordinateArray ar(num_points); read_coords_xyzm(ar); - std::auto_ptr line(new geometry_type(geometry_type::types::LineString)); + auto line = std::make_unique(geometry_type::types::LineString); line->move_to(ar[0].x, ar[0].y); for (int i = 1; i < num_points; ++i) { line->line_to(ar[i].x, ar[i].y); } - paths.push_back(line); + paths.push_back(line.release()); } } @@ -518,7 +518,7 @@ private: int num_rings = read_integer(); if (num_rings > 0) { - std::auto_ptr poly(new geometry_type(geometry_type::types::Polygon)); + auto poly = std::make_unique(geometry_type::types::Polygon); for (int i = 0; i < num_rings; ++i) { int num_points = read_integer(); @@ -535,7 +535,7 @@ private: } } if (poly->size() > 2) // ignore if polygon has less than 3 vertices - paths.push_back(poly); + paths.push_back(poly.release()); } }