Proper initialization of shared_ptr by boost::make_shared

This commit is contained in:
DennisOSRM 2012-09-19 09:29:03 +02:00
parent a8a0d1b216
commit 2faf9ad1b6
2 changed files with 2 additions and 2 deletions

View File

@ -90,8 +90,7 @@ EdgeBasedGraphFactory::EdgeBasedGraphFactory(int nodes, std::vector<NodeBasedEdg
}
std::vector<NodeBasedEdge>().swap(inputEdges);
std::sort( edges.begin(), edges.end() );
//TODO: move to make_shared
_nodeBasedGraph.reset(new _NodeBasedDynamicGraph( nodes, edges ));
_nodeBasedGraph = boost::make_shared<_NodeBasedDynamicGraph>( nodes, edges );
}
void EdgeBasedGraphFactory::GetEdgeBasedEdges(DeallocatingVector< EdgeBasedEdge >& outputEdgeList ) {

View File

@ -33,6 +33,7 @@
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/make_shared.hpp>
#include <boost/shared_ptr.hpp>