replace auto_ptr with unique_ptr (creeped in from 2.3.x)

This commit is contained in:
artemp 2014-07-10 12:28:52 +01:00
parent 6cd7026aac
commit 72e0889000

View file

@ -344,10 +344,10 @@ private:
{ {
double x = read_double(); double x = read_double();
double y = read_double(); double y = read_double();
std::auto_ptr<geometry_type> pt(new geometry_type(geometry_type::types::Point)); auto pt = std::make_unique<geometry_type>(geometry_type::types::Point);
pos_ += 16; pos_ += 16;
pt->move_to(x, y); pt->move_to(x, y);
paths.push_back(pt); paths.push_back(pt.release());
} }
void read_multipoint_xyz(boost::ptr_vector<geometry_type> & paths) void read_multipoint_xyz(boost::ptr_vector<geometry_type> & paths)
@ -421,13 +421,13 @@ private:
{ {
CoordinateArray ar(num_points); CoordinateArray ar(num_points);
read_coords_xyzm(ar); read_coords_xyzm(ar);
std::auto_ptr<geometry_type> line(new geometry_type(geometry_type::types::LineString)); auto line = std::make_unique<geometry_type>(geometry_type::types::LineString);
line->move_to(ar[0].x, ar[0].y); line->move_to(ar[0].x, ar[0].y);
for (int i = 1; i < num_points; ++i) for (int i = 1; i < num_points; ++i)
{ {
line->line_to(ar[i].x, ar[i].y); 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(); int num_rings = read_integer();
if (num_rings > 0) if (num_rings > 0)
{ {
std::auto_ptr<geometry_type> poly(new geometry_type(geometry_type::types::Polygon)); auto poly = std::make_unique<geometry_type>(geometry_type::types::Polygon);
for (int i = 0; i < num_rings; ++i) for (int i = 0; i < num_rings; ++i)
{ {
int num_points = read_integer(); int num_points = read_integer();
@ -535,7 +535,7 @@ private:
} }
} }
if (poly->size() > 2) // ignore if polygon has less than 3 vertices if (poly->size() > 2) // ignore if polygon has less than 3 vertices
paths.push_back(poly); paths.push_back(poly.release());
} }
} }