replace auto_ptr with unique_ptr (creeped in from 2.3.x)
This commit is contained in:
parent
6cd7026aac
commit
72e0889000
1 changed files with 6 additions and 6 deletions
12
src/wkb.cpp
12
src/wkb.cpp
|
@ -344,10 +344,10 @@ private:
|
|||
{
|
||||
double x = 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;
|
||||
pt->move_to(x, y);
|
||||
paths.push_back(pt);
|
||||
paths.push_back(pt.release());
|
||||
}
|
||||
|
||||
void read_multipoint_xyz(boost::ptr_vector<geometry_type> & paths)
|
||||
|
@ -421,13 +421,13 @@ private:
|
|||
{
|
||||
CoordinateArray ar(num_points);
|
||||
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);
|
||||
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<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)
|
||||
{
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue