Use make_shared as suggested by coding guidelines.

This commit is contained in:
Matt Amos 2011-10-13 19:34:28 +01:00
parent 1717104654
commit a2b4f9db59
2 changed files with 6 additions and 6 deletions

View File

@ -23,6 +23,7 @@
#include <boost/python.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/make_shared.hpp>
#include <mapnik/label_collision_detector.hpp>
#include <mapnik/map.hpp>
@ -32,6 +33,7 @@
using mapnik::label_collision_detector4;
using mapnik::box2d;
using mapnik::Map;
using boost::make_shared;
namespace
{
@ -39,8 +41,7 @@ namespace
boost::shared_ptr<label_collision_detector4>
create_label_collision_detector_from_extent(box2d<double> const &extent)
{
return boost::shared_ptr<label_collision_detector4>(
new label_collision_detector4(extent));
return make_shared<label_collision_detector4>(extent);
}
boost::shared_ptr<label_collision_detector4>
@ -48,8 +49,7 @@ create_label_collision_detector_from_map(Map const &m)
{
double buffer = m.buffer_size();
box2d<double> extent(-buffer, -buffer, m.width() + buffer, m.height() + buffer);
return boost::shared_ptr<label_collision_detector4>(
new label_collision_detector4(extent));
return make_shared<label_collision_detector4>(extent);
}
boost::python::list

View File

@ -73,7 +73,7 @@
// boost
#include <boost/utility.hpp>
#include <boost/make_shared.hpp>
// stl
#ifdef MAPNIK_DEBUG
@ -121,7 +121,7 @@ agg_renderer<T>::agg_renderer(Map const& m, T & pixmap, double scale_factor, uns
t_(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
font_engine_(),
font_manager_(font_engine_),
detector_(new label_collision_detector4(box2d<double>(-m.buffer_size(), -m.buffer_size(), m.width() + m.buffer_size() ,m.height() + m.buffer_size()))),
detector_(boost::make_shared<label_collision_detector4>(box2d<double>(-m.buffer_size(), -m.buffer_size(), m.width() + m.buffer_size() ,m.height() + m.buffer_size()))),
ras_ptr(new rasterizer)
{
setup(m);