Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ target_link_libraries(boost_graph
Boost::random
Boost::range
Boost::serialization
Boost::smart_ptr
Boost::spirit
Boost::throw_exception
Boost::tti
Expand Down
1 change: 0 additions & 1 deletion build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ constant boost_dependencies :
/boost/random//boost_random
/boost/range//boost_range
/boost/serialization//boost_serialization
/boost/smart_ptr//boost_smart_ptr
/boost/spirit//boost_spirit
/boost/throw_exception//boost_throw_exception
/boost/tti//boost_tti
Expand Down
4 changes: 2 additions & 2 deletions include/boost/graph/adjacency_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <boost/unordered_set.hpp>

#include <boost/scoped_ptr.hpp>
#include <memory>

#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_mutability_traits.hpp>
Expand Down Expand Up @@ -407,7 +407,7 @@ class adjacency_list
#endif

// protected: (would be protected if friends were more portable)
typedef scoped_ptr< graph_property_type > property_ptr;
using property_ptr = std::unique_ptr< graph_property_type >;
property_ptr m_property;
};

Expand Down
18 changes: 10 additions & 8 deletions include/boost/graph/detail/d_ary_heap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <utility>
#include <boost/assert.hpp>
#include <boost/static_assert.hpp>
#include <boost/shared_array.hpp>
#include <memory>
#include <boost/property_map/property_map.hpp>

// WARNING: it is not safe to copy a d_ary_heap_indirect and then modify one of
Expand Down Expand Up @@ -45,23 +45,25 @@ namespace detail
{
template < typename Value > class fixed_max_size_vector
{
boost::shared_array< Value > m_data;
// todo : C++17: replace with std::shared_ptr<T[]>
std::shared_ptr< Value > m_data;
std::size_t m_size;

public:
typedef std::size_t size_type;
fixed_max_size_vector(std::size_t max_size)
: m_data(new Value[max_size]), m_size(0)
: m_data(new Value[max_size], std::default_delete< Value[] >())
, m_size(0)
{
}
std::size_t size() const { return m_size; }
bool empty() const { return m_size == 0; }
Value& operator[](std::size_t i) { return m_data[i]; }
const Value& operator[](std::size_t i) const { return m_data[i]; }
void push_back(Value v) { m_data[m_size++] = v; }
Value& operator[](std::size_t i) { return m_data.get()[i]; }
const Value& operator[](std::size_t i) const { return m_data.get()[i]; }
void push_back(Value v) { m_data.get()[m_size++] = v; }
void pop_back() { --m_size; }
Value& back() { return m_data[m_size - 1]; }
const Value& back() const { return m_data[m_size - 1]; }
Value& back() { return m_data.get()[m_size - 1]; }
const Value& back() const { return m_data.get()[m_size - 1]; }
};
}

Expand Down
10 changes: 5 additions & 5 deletions include/boost/graph/dijkstra_shortest_paths.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <boost/pending/indirect_cmp.hpp>
#include <boost/graph/exception.hpp>
#include <boost/graph/overloading.hpp>
#include <boost/smart_ptr.hpp>
#include <memory>
#include <boost/graph/detail/d_ary_heap.hpp>
#include <boost/graph/two_bit_color_map.hpp>
#include <boost/graph/detail/mpi_include.hpp>
Expand Down Expand Up @@ -237,7 +237,7 @@ namespace detail
{
typedef boost::iterator_property_map< Value*, IndexMap > type;
static type build(const Graph& g, const IndexMap& index,
boost::scoped_array< Value >& array_holder)
std::unique_ptr< Value[] >& array_holder)
{
array_holder.reset(new Value[num_vertices(g)]);
std::fill(array_holder.get(), array_holder.get() + num_vertices(g),
Expand All @@ -251,7 +251,7 @@ namespace detail
{
typedef boost::vector_property_map< Value, IndexMap > type;
static type build(const Graph& g, const IndexMap& index,
boost::scoped_array< Value >& array_holder)
std::unique_ptr< Value[] >& array_holder)
{
return boost::make_vector_property_map< Value >(index);
}
Expand All @@ -268,7 +268,7 @@ namespace detail
helper;
typedef typename helper::type type;
static type build(const Graph& g, const IndexMap& index,
boost::scoped_array< Value >& array_holder)
std::unique_ptr< Value[] >& array_holder)
{
return helper::build(g, index, array_holder);
}
Expand Down Expand Up @@ -368,7 +368,7 @@ inline void dijkstra_shortest_paths_no_init(const Graph& g,
typedef typename graph_traits< Graph >::vertex_descriptor Vertex;

// Now the default: use a d-ary heap
boost::scoped_array< std::size_t > index_in_heap_map_holder;
std::unique_ptr< std::size_t[] > index_in_heap_map_holder;
typedef detail::vertex_property_map_generator< Graph, IndexMap,
std::size_t >
IndexInHeapMapHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <boost/graph/detail/d_ary_heap.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <memory>

namespace boost
{
Expand Down Expand Up @@ -51,7 +52,7 @@ void dijkstra_shortest_paths_no_color_map_no_init(const Graph& graph,
DistanceCompare >
VertexQueue;

boost::scoped_array< std::size_t > index_in_heap_map_holder;
std::unique_ptr< std::size_t[] > index_in_heap_map_holder;
IndexInHeapMap index_in_heap = IndexInHeapMapHelper::build(
graph, index_map, index_in_heap_map_holder);
VertexQueue vertex_queue(distance_map, index_in_heap, distance_compare);
Expand Down
4 changes: 2 additions & 2 deletions include/boost/graph/erdos_renyi_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <boost/assert.hpp>
#include <iterator>
#include <utility>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <boost/random/uniform_int.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/random/geometric_distribution.hpp>
Expand Down Expand Up @@ -207,7 +207,7 @@ class sorted_erdos_renyi_iterator
src = (std::numeric_limits< vertices_size_type >::max)();
}

shared_ptr< uniform_01< RandomGenerator* > > gen;
std::shared_ptr< uniform_01< RandomGenerator* > > gen;
geometric_distribution< vertices_size_type > rand_vertex;
vertices_size_type n;
bool allow_self_loops;
Expand Down
1 change: 0 additions & 1 deletion include/boost/graph/gursoy_atun_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <boost/graph/properties.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/named_function_params.hpp>
Expand Down
12 changes: 6 additions & 6 deletions include/boost/graph/incremental_components.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <boost/tuple/tuple.hpp>
#include <boost/graph/detail/incremental_components.hpp>
#include <boost/iterator/counting_iterator.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <memory>
#include <boost/pending/disjoint_sets.hpp>
#include <iterator>

Expand Down Expand Up @@ -126,8 +126,8 @@ template < typename IndexType > class component_index
component_index(ParentIterator parent_start, ParentIterator parent_end,
const ElementIndexMap& index_map)
: m_num_elements(std::distance(parent_start, parent_end))
, m_components(make_shared< IndexContainer >())
, m_index_list(make_shared< IndexContainer >(m_num_elements))
, m_components(std::make_shared< IndexContainer >())
, m_index_list(std::make_shared< IndexContainer >(m_num_elements))
{

build_index_lists(parent_start, index_map);
Expand All @@ -137,8 +137,8 @@ template < typename IndexType > class component_index
template < typename ParentIterator >
component_index(ParentIterator parent_start, ParentIterator parent_end)
: m_num_elements(std::distance(parent_start, parent_end))
, m_components(make_shared< IndexContainer >())
, m_index_list(make_shared< IndexContainer >(m_num_elements))
, m_components(std::make_shared< IndexContainer >())
, m_index_list(std::make_shared< IndexContainer >(m_num_elements))
{

build_index_lists(parent_start, boost::identity_property_map());
Expand Down Expand Up @@ -225,7 +225,7 @@ template < typename IndexType > class component_index

protected:
IndexType m_num_elements;
shared_ptr< IndexContainer > m_components, m_index_list;
std::shared_ptr< IndexContainer > m_components, m_index_list;

}; // class component_index

Expand Down
1 change: 0 additions & 1 deletion include/boost/graph/isomorphism.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <algorithm>
#include <boost/config.hpp>
#include <boost/assert.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/graph/depth_first_search.hpp>
#include <boost/detail/algorithm.hpp>
#include <boost/unordered_map.hpp>
Expand Down
22 changes: 11 additions & 11 deletions include/boost/graph/mcgregor_common_subgraphs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <vector>
#include <stack>

#include <boost/make_shared.hpp>
#include <memory>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/filtered_graph.hpp>
#include <boost/graph/graph_utility.hpp>
Expand Down Expand Up @@ -559,7 +559,7 @@ namespace detail
, m_graph2(graph2)
, m_vindex_map1(vindex_map1)
, m_vindex_map2(vindex_map2)
, m_subgraphs(make_shared< SubGraphList >())
, m_subgraphs(std::make_shared< SubGraphList >())
, m_user_callback(user_callback)
{
}
Expand Down Expand Up @@ -627,7 +627,7 @@ namespace detail
const GraphFirst& m_graph2;
const VertexIndexMapFirst m_vindex_map1;
const VertexIndexMapSecond m_vindex_map2;
shared_ptr< SubGraphList > m_subgraphs;
std::shared_ptr< SubGraphList > m_subgraphs;
SubGraphCallback m_user_callback;
};

Expand Down Expand Up @@ -732,8 +732,8 @@ namespace detail
, m_graph2(graph2)
, m_vindex_map1(vindex_map1)
, m_vindex_map2(vindex_map2)
, m_subgraphs(make_shared< SubGraphList >())
, m_largest_size_so_far(make_shared< VertexSizeFirst >(0))
, m_subgraphs(std::make_shared< SubGraphList >())
, m_largest_size_so_far(std::make_shared< VertexSizeFirst >(0))
, m_user_callback(user_callback)
{
}
Expand Down Expand Up @@ -801,8 +801,8 @@ namespace detail
const GraphFirst& m_graph2;
const VertexIndexMapFirst m_vindex_map1;
const VertexIndexMapSecond m_vindex_map2;
shared_ptr< SubGraphList > m_subgraphs;
shared_ptr< VertexSizeFirst > m_largest_size_so_far;
std::shared_ptr< SubGraphList > m_subgraphs;
std::shared_ptr< VertexSizeFirst > m_largest_size_so_far;
SubGraphCallback m_user_callback;
};

Expand Down Expand Up @@ -910,8 +910,8 @@ namespace detail
, m_graph2(graph2)
, m_vindex_map1(vindex_map1)
, m_vindex_map2(vindex_map2)
, m_subgraphs(make_shared< SubGraphList >())
, m_largest_size_so_far(make_shared< VertexSizeFirst >(0))
, m_subgraphs(std::make_shared< SubGraphList >())
, m_largest_size_so_far(std::make_shared< VertexSizeFirst >(0))
, m_user_callback(user_callback)
{
}
Expand Down Expand Up @@ -996,8 +996,8 @@ namespace detail
const GraphFirst& m_graph2;
const VertexIndexMapFirst m_vindex_map1;
const VertexIndexMapSecond m_vindex_map2;
shared_ptr< SubGraphList > m_subgraphs;
shared_ptr< VertexSizeFirst > m_largest_size_so_far;
std::shared_ptr< SubGraphList > m_subgraphs;
std::shared_ptr< VertexSizeFirst > m_largest_size_so_far;
SubGraphCallback m_user_callback;
};

Expand Down
1 change: 0 additions & 1 deletion include/boost/graph/metric_tsp_approx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <vector>

#include <boost/shared_ptr.hpp>
#include <boost/concept_check.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_as_tree.hpp>
Expand Down
8 changes: 5 additions & 3 deletions include/boost/graph/one_bit_color_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <boost/property_map/property_map.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/detail/mpi_include.hpp>
#include <boost/shared_array.hpp>
#include <memory>
#include <boost/config.hpp>
#include <boost/assert.hpp>
#include <algorithm>
Expand Down Expand Up @@ -45,7 +45,8 @@ template < typename IndexMap = identity_property_map > struct one_bit_color_map
int, bits_per_char = std::numeric_limits< unsigned char >::digits);
std::size_t n;
IndexMap index;
shared_array< unsigned char > data;
// todo : C++17: replace with std::shared_ptr<T[]>
std::shared_ptr< unsigned char > data;

typedef typename property_traits< IndexMap >::key_type key_type;
typedef one_bit_color_type value_type;
Expand All @@ -56,7 +57,8 @@ template < typename IndexMap = identity_property_map > struct one_bit_color_map
std::size_t n, const IndexMap& index = IndexMap())
: n(n)
, index(index)
, data(new unsigned char[(n + bits_per_char - 1) / bits_per_char]())
, data(new unsigned char[(n + bits_per_char - 1) / bits_per_char](),
std::default_delete< unsigned char[] >())
{
}
};
Expand Down
6 changes: 3 additions & 3 deletions include/boost/graph/planar_detail/boyer_myrvold_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <list>
#include <boost/next_prior.hpp>
#include <boost/config.hpp> //for std::min macros
#include <boost/shared_ptr.hpp>
#include <memory>
#include <boost/tuple/tuple.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graph_traits.hpp>
Expand Down Expand Up @@ -150,8 +150,8 @@ class boyer_myrvold_impl
typedef std::vector< edge_t > edge_vector_t;
typedef std::list< vertex_t > vertex_list_t;
typedef std::list< face_handle_t > face_handle_list_t;
typedef boost::shared_ptr< face_handle_list_t > face_handle_list_ptr_t;
typedef boost::shared_ptr< vertex_list_t > vertex_list_ptr_t;
using face_handle_list_ptr_t = std::shared_ptr< face_handle_list_t >;
using vertex_list_ptr_t = std::shared_ptr< vertex_list_t >;
typedef boost::tuple< vertex_t, bool, bool > merge_stack_frame_t;
typedef std::vector< merge_stack_frame_t > merge_stack_t;

Expand Down
12 changes: 6 additions & 6 deletions include/boost/graph/planar_detail/face_handles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include <list>
#include <boost/graph/graph_traits.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>

// A "face handle" is an optimization meant to serve two purposes in
// the implementation of the Boyer-Myrvold planarity test: (1) it holds
Expand Down Expand Up @@ -74,7 +74,7 @@ namespace graph

template < typename DataType > struct lazy_list_node
{
typedef shared_ptr< lazy_list_node< DataType > > ptr_t;
using ptr_t = std::shared_ptr< lazy_list_node< DataType > >;

lazy_list_node(const DataType& data)
: m_reversed(false), m_data(data), m_has_data(true)
Expand All @@ -92,8 +92,8 @@ namespace graph
bool m_reversed;
DataType m_data;
bool m_has_data;
shared_ptr< lazy_list_node > m_left_child;
shared_ptr< lazy_list_node > m_right_child;
std::shared_ptr< lazy_list_node > m_left_child;
std::shared_ptr< lazy_list_node > m_right_child;
};

template < typename StoreOldHandlesPolicy, typename Vertex,
Expand Down Expand Up @@ -136,7 +136,7 @@ namespace graph
struct edge_list_storage< recursive_lazy_list, Edge >
{
typedef lazy_list_node< Edge > node_type;
typedef shared_ptr< node_type > type;
using type = std::shared_ptr< node_type >;
type value;

void push_back(Edge e)
Expand Down Expand Up @@ -443,7 +443,7 @@ namespace graph

void store_old_face_handles_dispatch(no_old_handles) {}

boost::shared_ptr< impl_t > pimpl;
std::shared_ptr< impl_t > pimpl;
};

} /* namespace detail */
Expand Down
Loading
Loading