Skip to content
Open
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
17 changes: 8 additions & 9 deletions include/boost/graph/adjacency_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
#include <boost/graph/graph_mutability_traits.hpp>
#include <boost/graph/graph_selectors.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/graph/detail/edge.hpp>
#include <boost/type_traits/is_same.hpp>
#include <type_traits>
#include <boost/detail/workaround.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/named_graph.hpp>
Expand Down Expand Up @@ -220,16 +218,16 @@ struct adjacency_list_traits
typedef typename DirectedS::is_bidir_t is_bidir;
typedef typename DirectedS::is_directed_t is_directed;

typedef typename mpl::if_< is_bidir, bidirectional_tag,
typename mpl::if_< is_directed, directed_tag,
typedef typename std::conditional< is_bidir::value, bidirectional_tag,
typename std::conditional< is_directed::value, directed_tag,
undirected_tag >::type >::type directed_category;

typedef typename parallel_edge_traits< OutEdgeListS >::type
edge_parallel_category;

typedef std::size_t vertices_size_type;
typedef void* vertex_ptr;
typedef typename mpl::if_< is_rand_access, vertices_size_type,
typedef typename std::conditional< is_rand_access::value, vertices_size_type,
vertex_ptr >::type vertex_descriptor;
typedef detail::edge_desc_impl< directed_category, vertex_descriptor >
edge_descriptor;
Expand All @@ -242,11 +240,12 @@ struct adjacency_list_traits
typedef typename container_gen< EdgeListS, dummy >::type EdgeContainer;
typedef typename DirectedS::is_bidir_t BidirectionalT;
typedef typename DirectedS::is_directed_t DirectedT;
typedef typename mpl::and_< DirectedT,
typename mpl::not_< BidirectionalT >::type >::type on_edge_storage;
typedef std::integral_constant< bool,
DirectedT::value && !BidirectionalT::value >
on_edge_storage;

public:
typedef typename mpl::if_< on_edge_storage, std::size_t,
typedef typename std::conditional< on_edge_storage::value, std::size_t,
typename EdgeContainer::size_type >::type edges_size_type;
};

Expand Down
21 changes: 10 additions & 11 deletions include/boost/graph/adjacency_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/graph_mutability_traits.hpp>
#include <boost/graph/graph_selectors.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <type_traits>
#include <boost/graph/adjacency_iterator.hpp>
#include <boost/graph/detail/edge.hpp>
#include <boost/iterator/iterator_adaptor.hpp>
Expand Down Expand Up @@ -413,7 +412,7 @@ template < typename Directed = directedS > class adjacency_matrix_traits
// in_degree, etc.).
BOOST_STATIC_ASSERT(!(is_same< Directed, bidirectionalS >::value));

typedef typename mpl::if_< is_directed, bidirectional_tag,
typedef typename std::conditional< is_directed::value, bidirectional_tag,
undirected_tag >::type directed_category;

typedef disallow_parallel_edge_tag edge_parallel_category;
Expand Down Expand Up @@ -470,7 +469,7 @@ class adjacency_matrix

public: // should be private
typedef
typename mpl::if_< typename has_property< edge_property_type >::type,
typename std::conditional< has_property< edge_property_type >::type::value,
std::pair< bool, edge_property_type >, char >::type StoredEdge;
#if defined(BOOST_NO_STD_ALLOCATOR)
typedef std::vector< StoredEdge > Matrix;
Expand Down Expand Up @@ -510,7 +509,7 @@ class adjacency_matrix
MatrixIter, size_type, edge_descriptor >
UnDirOutEdgeIter;

typedef typename mpl::if_< typename Directed::is_directed_t, DirOutEdgeIter,
typedef typename std::conditional< Directed::is_directed_t::value, DirOutEdgeIter,
UnDirOutEdgeIter >::type unfiltered_out_edge_iter;

typedef detail::dir_adj_matrix_in_edge_iter< vertex_descriptor, MatrixIter,
Expand All @@ -521,7 +520,7 @@ class adjacency_matrix
MatrixIter, size_type, edge_descriptor >
UnDirInEdgeIter;

typedef typename mpl::if_< typename Directed::is_directed_t, DirInEdgeIter,
typedef typename std::conditional< Directed::is_directed_t::value, DirInEdgeIter,
UnDirInEdgeIter >::type unfiltered_in_edge_iter;

typedef detail::adj_matrix_edge_iter< Directed, MatrixIter, size_type,
Expand Down Expand Up @@ -1103,7 +1102,7 @@ struct adj_mat_pm_helper< D, VP, EP, GP, A, Tag, edge_property_tag >
{
Tag tag;
lookup_property_from_edge(Tag tag) : tag(tag) {}
typedef typename boost::mpl::if_< IsConst, const EP, EP >::type
typedef typename std::conditional< IsConst::value, const EP, EP >::type
ep_type_nonref;
typedef ep_type_nonref& ep_type;
typedef typename lookup_one_property< ep_type_nonref, Tag >::type&
Expand All @@ -1116,20 +1115,20 @@ struct adj_mat_pm_helper< D, VP, EP, GP, A, Tag, edge_property_tag >
};

typedef function_property_map<
lookup_property_from_edge< boost::mpl::false_ >,
lookup_property_from_edge< std::false_type >,
typename graph_traits<
adjacency_matrix< D, VP, EP, GP, A > >::edge_descriptor >
type;
typedef function_property_map<
lookup_property_from_edge< boost::mpl::true_ >,
lookup_property_from_edge< std::true_type >,
typename graph_traits<
adjacency_matrix< D, VP, EP, GP, A > >::edge_descriptor >
const_type;
typedef edge_descriptor arg_type;
typedef
typename lookup_property_from_edge< boost::mpl::false_ >::result_type
typename lookup_property_from_edge< std::false_type >::result_type
single_nonconst_type;
typedef typename lookup_property_from_edge< boost::mpl::true_ >::result_type
typedef typename lookup_property_from_edge< std::true_type >::result_type
single_const_type;

static type get_nonconst(adjacency_matrix< D, VP, EP, GP, A >& g, Tag tag)
Expand Down
6 changes: 3 additions & 3 deletions include/boost/graph/betweenness_centrality.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/if.hpp>
#include <type_traits>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/named_function_params.hpp>
#include <algorithm>
Expand Down Expand Up @@ -451,7 +451,7 @@ namespace detail
degree_size_type;
typedef
typename graph_traits< Graph >::edge_descriptor edge_descriptor;
typedef typename mpl::if_c<
typedef typename std::conditional<
(is_same< CentralityMap, dummy_property_map >::value),
EdgeCentralityMap, CentralityMap >::type a_centrality_map;
typedef typename property_traits< a_centrality_map >::value_type
Expand Down Expand Up @@ -483,7 +483,7 @@ namespace detail
degree_size_type;
typedef
typename graph_traits< Graph >::edge_descriptor edge_descriptor;
typedef typename mpl::if_c<
typedef typename std::conditional<
(is_same< CentralityMap, dummy_property_map >::value),
EdgeCentralityMap, CentralityMap >::type a_centrality_map;
typedef typename property_traits< a_centrality_map >::value_type
Expand Down
2 changes: 0 additions & 2 deletions include/boost/graph/compressed_sparse_row_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <boost/property_map/property_map.hpp>
#include <boost/integer.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/mpl/if.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/graph/graph_selectors.hpp>
#include <boost/graph/detail/is_distributed_selector.hpp>
Expand All @@ -45,7 +44,6 @@
#include <boost/functional/hash.hpp>
#include <boost/next_prior.hpp>
#include <boost/property_map/transform_value_property_map.hpp>
#include <boost/mpl/print.hpp>

namespace boost
{
Expand Down
50 changes: 26 additions & 24 deletions include/boost/graph/detail/adjacency_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@

#include <boost/iterator/iterator_adaptor.hpp>

#include <boost/mpl/if.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/and.hpp>
#include <type_traits>
#include <boost/graph/graph_concepts.hpp>
#include <boost/pending/container_traits.hpp>
#include <boost/graph/detail/adj_list_edge_iterator.hpp>
Expand Down Expand Up @@ -2343,8 +2341,8 @@ namespace detail
typedef typename container_gen< VertexListS, vertex_ptr >::type
SeqVertexList;
typedef boost::integer_range< vertex_descriptor > RandVertexList;
typedef typename mpl::if_< is_rand_access, RandVertexList,
SeqVertexList >::type VertexList;
typedef typename std::conditional< is_rand_access::value,
RandVertexList, SeqVertexList >::type VertexList;

typedef typename VertexList::iterator vertex_iterator;

Expand All @@ -2354,21 +2352,22 @@ namespace detail
list_edge< vertex_descriptor, EdgeProperty > >::type
EdgeContainer;

typedef typename mpl::and_< DirectedT,
typename mpl::not_< BidirectionalT >::type >::type
typedef std::integral_constant< bool,
DirectedT::value && !BidirectionalT::value >
on_edge_storage;

typedef typename mpl::if_< on_edge_storage, std::size_t,
typename EdgeContainer::size_type >::type edges_size_type;
typedef typename std::conditional< on_edge_storage::value,
std::size_t, typename EdgeContainer::size_type >::type
edges_size_type;

typedef typename EdgeContainer::iterator EdgeIter;

typedef
typename detail::is_random_access< EdgeListS >::type is_edge_ra;

typedef typename mpl::if_< on_edge_storage,
typedef typename std::conditional< on_edge_storage::value,
stored_edge_property< vertex_descriptor, EdgeProperty >,
typename mpl::if_< is_edge_ra,
typename std::conditional< is_edge_ra::value,
stored_ra_edge_iter< vertex_descriptor, EdgeContainer,
EdgeProperty >,
stored_edge_iter< vertex_descriptor, EdgeIter,
Expand Down Expand Up @@ -2421,8 +2420,8 @@ namespace detail
graph_type >
DirectedEdgeIter;

typedef typename mpl::if_< on_edge_storage, DirectedEdgeIter,
UndirectedEdgeIter >::type edge_iterator;
typedef typename std::conditional< on_edge_storage::value,
DirectedEdgeIter, UndirectedEdgeIter >::type edge_iterator;

// stored_vertex and StoredVertexList
typedef typename container_gen< VertexListS, vertex_ptr >::type
Expand Down Expand Up @@ -2464,11 +2463,12 @@ namespace detail
InEdgeList m_in_edges;
VertexProperty m_property;
};
typedef typename mpl::if_< is_rand_access,
typename mpl::if_< BidirectionalT, bidir_rand_stored_vertex,
rand_stored_vertex >::type,
typename mpl::if_< BidirectionalT, bidir_seq_stored_vertex,
seq_stored_vertex >::type >::type StoredVertex;
typedef typename std::conditional< is_rand_access::value,
typename std::conditional< BidirectionalT::value,
bidir_rand_stored_vertex, rand_stored_vertex >::type,
typename std::conditional< BidirectionalT::value,
bidir_seq_stored_vertex, seq_stored_vertex >::type >::type
StoredVertex;
struct stored_vertex : public StoredVertex
{
stored_vertex() {}
Expand All @@ -2477,17 +2477,19 @@ namespace detail

typedef typename container_gen< VertexListS, stored_vertex >::type
RandStoredVertexList;
typedef typename mpl::if_< is_rand_access, RandStoredVertexList,
SeqStoredVertexList >::type StoredVertexList;
typedef typename std::conditional< is_rand_access::value,
RandStoredVertexList, SeqStoredVertexList >::type
StoredVertexList;
}; // end of config

typedef typename mpl::if_< BidirectionalT,
typedef typename std::conditional< BidirectionalT::value,
bidirectional_graph_helper_with_property< config >,
typename mpl::if_< DirectedT, directed_graph_helper< config >,
typename std::conditional< DirectedT::value,
directed_graph_helper< config >,
undirected_graph_helper< config > >::type >::type
DirectedHelper;

typedef typename mpl::if_< is_rand_access,
typedef typename std::conditional< is_rand_access::value,
vec_adj_list_impl< Graph, config, DirectedHelper >,
adj_list_impl< Graph, config, DirectedHelper > >::type type;
};
Expand Down Expand Up @@ -2687,7 +2689,7 @@ namespace detail
{
template < class Tag, class Graph, class Property >
struct adj_list_choose_vertex_pa
: boost::mpl::if_< boost::is_same< Tag, vertex_all_t >,
: std::conditional< boost::is_same< Tag, vertex_all_t >::value,
adj_list_all_vertex_pa, adj_list_any_vertex_pa >::type ::
template bind_< Tag, Graph, Property >
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <boost/property_map/property_map.hpp>
#include <boost/integer.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/mpl/if.hpp>
#include <boost/graph/graph_selectors.hpp>
#include <boost/static_assert.hpp>
#include <boost/functional/hash.hpp>
Expand Down
5 changes: 3 additions & 2 deletions include/boost/graph/detail/index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <type_traits>

// The structures in this module are responsible for selecting and defining
// types for accessing a builting index map. Note that the selection of these
Expand Down Expand Up @@ -67,8 +68,8 @@ namespace detail
// VertexEdgeGraph - whichever type Key is selecting.
template < typename Graph, typename Key > struct choose_indexer
{
typedef typename mpl::if_<
is_same< Key, typename graph_traits< Graph >::vertex_descriptor >,
typedef typename std::conditional<
is_same< Key, typename graph_traits< Graph >::vertex_descriptor >::value,
vertex_indexer< Graph >, edge_indexer< Graph > >::type indexer_type;
typedef typename indexer_type::index_type index_type;
};
Expand Down
1 change: 0 additions & 1 deletion include/boost/graph/detail/indexed_properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <boost/integer.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/mpl/if.hpp>

namespace boost
{
Expand Down
4 changes: 2 additions & 2 deletions include/boost/graph/detail/is_distributed_selector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#ifndef BOOST_GRAPH_DETAIL_IS_DISTRIBUTED_SELECTOR_HPP
#define BOOST_GRAPH_DETAIL_IS_DISTRIBUTED_SELECTOR_HPP

#include <boost/mpl/bool.hpp>
#include <type_traits>

namespace boost
{
namespace detail
{
template < typename > struct is_distributed_selector : boost::mpl::false_
template < typename > struct is_distributed_selector : std::false_type
{
};
}
Expand Down
1 change: 0 additions & 1 deletion include/boost/graph/directed_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <boost/pending/property.hpp>
#include <boost/property_map/transform_value_property_map.hpp>
#include <boost/type_traits.hpp>
#include <boost/mpl/if.hpp>

namespace boost
{
Expand Down
9 changes: 4 additions & 5 deletions include/boost/graph/edge_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@

#include <iterator>
#include <boost/config.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp>
#include <type_traits>
#include <boost/range/irange.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
Expand Down Expand Up @@ -264,15 +263,15 @@ template < class Cat > struct is_random
{
RET = false
};
typedef mpl::false_ type;
typedef std::false_type type;
};
template <> struct is_random< std::random_access_iterator_tag >
{
enum
{
RET = true
};
typedef mpl::true_ type;
typedef std::true_type type;
};

// The edge_list class conditionally inherits from one of the
Expand All @@ -287,7 +286,7 @@ template < class EdgeIter,
class T, class D, class Cat >
#endif
class edge_list
: public mpl::if_< typename is_random< Cat >::type,
: public std::conditional< is_random< Cat >::type::value,
edge_list_impl_ra< edge_list< EdgeIter, T, D, Cat >, EdgeIter, T, D >,
edge_list_impl< edge_list< EdgeIter, T, D, Cat >, EdgeIter, T, D > >::type
{
Expand Down
Loading
Loading