Commit 077b32e1 authored by Tiago Peixoto's avatar Tiago Peixoto

Replace shared_ptr<T>(new T()) by make_shared<T>()

parent a35440a9
Pipeline #8 canceled with stage
......@@ -30,7 +30,7 @@ using namespace graph_tool;
// this is the constructor for the graph interface
GraphInterface::GraphInterface()
:_mg(new multigraph_t()),
:_mg(std::make_shared<multigraph_t>()),
_vertex_index(get(vertex_index, *_mg)),
_edge_index(get(edge_index_t(), *_mg)),
_reversed(false),
......
......@@ -291,7 +291,7 @@ struct do_graph_copy
GraphInterface::GraphInterface(const GraphInterface& gi, bool keep_ref,
python::object ovprops, python::object oeprops,
python::object vorder)
:_mg(keep_ref ? gi._mg : std::shared_ptr<multigraph_t>(new multigraph_t())),
:_mg(keep_ref ? gi._mg : std::make_shared<multigraph_t>()),
_vertex_index(get(vertex_index, *_mg)),
_edge_index(get(edge_index_t(), *_mg)),
_reversed(gi._reversed),
......
......@@ -527,7 +527,7 @@ std::shared_ptr<Graph> get_graph_ptr(GraphInterface& gi, GraphInit&, std::true_t
template <class Graph, class GraphInit>
std::shared_ptr<Graph> get_graph_ptr(GraphInterface&, GraphInit& g, std::false_type)
{
return std::shared_ptr<Graph>(new Graph(g));
return std::make_shared<Graph>(g);
}
// this function retrieves a graph view stored in graph_views, or stores one if
......
......@@ -537,7 +537,8 @@ public:
typedef typename boost::property_traits<prop_map_t>::category category;
HashedDescriptorMap(IndexMap index_map)
: _base_map(new map_t(0, hashfc_t(index_map))), _prop_map(*_base_map) {}
: _base_map(std::make_shared<map_t>(0, hashfc_t(index_map))),
_prop_map(*_base_map) {}
HashedDescriptorMap(){}
reference operator[](const key_type& k) { return _prop_map[k]; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment