From a237fb8cd974c04b59b93b2f5d3f87aba0899732 Mon Sep 17 00:00:00 2001 From: Ronald Garcia Date: Mon, 4 Dec 2006 23:23:08 +0000 Subject: [PATCH] Replaced uses of ct_if and friends (based on pending/ct_if.hpp) with uses of mpl::if_ and friends. [SVN r36269] --- include/boost/graph/adjacency_list.hpp | 25 ++++++++------- include/boost/graph/adjacency_matrix.hpp | 14 ++++---- .../graph/compressed_sparse_row_graph.hpp | 2 +- include/boost/graph/detail/adjacency_list.hpp | 32 ++++++++++--------- include/boost/graph/detail/bitset.hpp | 4 +-- include/boost/graph/detail/is_same.hpp | 4 +-- include/boost/graph/edge_list.hpp | 9 +++--- include/boost/graph/graph_selectors.hpp | 14 ++++---- .../graph/johnson_all_pairs_shortest.hpp | 1 - include/boost/graph/properties.hpp | 4 +-- include/boost/graph/property_iter_range.hpp | 4 +-- 11 files changed, 60 insertions(+), 53 deletions(-) diff --git a/include/boost/graph/adjacency_list.hpp b/include/boost/graph/adjacency_list.hpp index 9719ead1..a60916a2 100644 --- a/include/boost/graph/adjacency_list.hpp +++ b/include/boost/graph/adjacency_list.hpp @@ -36,7 +36,10 @@ #include #include #include -#include +#include +#include +#include +#include #include #include #include @@ -238,12 +241,12 @@ namespace boost { namespace detail { template struct is_random_access { enum { value = false}; - typedef false_type type; + typedef mpl::false_ type; }; template <> struct is_random_access { enum { value = true }; - typedef true_type type; + typedef mpl::true_ type; }; } // namespace detail @@ -268,9 +271,9 @@ namespace boost { typedef typename DirectedS::is_bidir_t is_bidir; typedef typename DirectedS::is_directed_t is_directed; - typedef typename boost::ct_if_t::type >::type directed_category; @@ -279,7 +282,7 @@ namespace boost { edge_parallel_category; typedef void* vertex_ptr; - typedef typename boost::ct_if_t::type vertex_descriptor; typedef detail::edge_desc_impl edge_descriptor; @@ -292,10 +295,10 @@ namespace boost { typedef typename container_gen::type EdgeContainer; typedef typename DirectedS::is_bidir_t BidirectionalT; typedef typename DirectedS::is_directed_t DirectedT; - typedef typename ct_and::type >::type on_edge_storage; + typedef typename mpl::and_::type >::type on_edge_storage; public: - typedef typename boost::ct_if_t::type edges_size_type; @@ -352,10 +355,10 @@ namespace boost { edge_property_type; // The types that are actually bundled - typedef typename ct_if<(is_same::value), + typedef typename mpl::if_c<(is_same::value), no_vertex_bundle, maybe_vertex_bundled>::type vertex_bundled; - typedef typename ct_if<(is_same::value), + typedef typename mpl::if_c<(is_same::value), no_edge_bundle, maybe_edge_bundled>::type edge_bundled; #else diff --git a/include/boost/graph/adjacency_matrix.hpp b/include/boost/graph/adjacency_matrix.hpp index 34a16dd7..cdcb69b3 100644 --- a/include/boost/graph/adjacency_matrix.hpp +++ b/include/boost/graph/adjacency_matrix.hpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -438,7 +438,7 @@ namespace boost { // in_degree, etc.). BOOST_STATIC_ASSERT(!(is_same::value)); - typedef typename boost::ct_if_t::type directed_category; @@ -492,10 +492,10 @@ namespace boost { public: // The types that are actually bundled - typedef typename ct_if<(is_same::value), + typedef typename mpl::if_c<(is_same::value), no_vertex_bundle, maybe_vertex_bundled>::type vertex_bundled; - typedef typename ct_if<(is_same::value), + typedef typename mpl::if_c<(is_same::value), no_edge_bundle, maybe_edge_bundled>::type edge_bundled; #else @@ -506,7 +506,7 @@ namespace boost { #endif public: // should be private - typedef typename ct_if_t::type, + typedef typename mpl::if_::type, std::pair, char>::type StoredEdge; #if (defined(BOOST_MSVC) && BOOST_MSVC <= 1300) || defined(BOOST_NO_STD_ALLOCATOR) typedef std::vector Matrix; @@ -540,7 +540,7 @@ namespace boost { vertex_descriptor, MatrixIter, size_type, edge_descriptor > UnDirOutEdgeIter; - typedef typename ct_if_t< + typedef typename mpl::if_< typename Directed::is_directed_t, DirOutEdgeIter, UnDirOutEdgeIter >::type unfiltered_out_edge_iter; @@ -552,7 +552,7 @@ namespace boost { vertex_descriptor, MatrixIter, size_type, edge_descriptor > UnDirInEdgeIter; - typedef typename ct_if_t< + typedef typename mpl::if_< typename Directed::is_directed_t, DirInEdgeIter, UnDirInEdgeIter >::type unfiltered_in_edge_iter; diff --git a/include/boost/graph/compressed_sparse_row_graph.hpp b/include/boost/graph/compressed_sparse_row_graph.hpp index 161929cd..8615eda3 100644 --- a/include/boost/graph/compressed_sparse_row_graph.hpp +++ b/include/boost/graph/compressed_sparse_row_graph.hpp @@ -739,7 +739,7 @@ private: typedef graph_traits traits; typedef VertexProperty vertex_bundled; typedef EdgeProperty edge_bundled; - typedef typename ct_if<(detail::is_vertex_bundle::value), + typedef typename mpl::if_c<(detail::is_vertex_bundle::value), typename traits::vertex_descriptor, typename traits::edge_descriptor>::type descriptor; diff --git a/include/boost/graph/detail/adjacency_list.hpp b/include/boost/graph/detail/adjacency_list.hpp index 14474a17..949422c2 100644 --- a/include/boost/graph/detail/adjacency_list.hpp +++ b/include/boost/graph/detail/adjacency_list.hpp @@ -24,7 +24,9 @@ #include -#include +#include +#include +#include #include #include #include @@ -2273,7 +2275,7 @@ namespace boost { typedef typename container_gen::type SeqVertexList; typedef boost::integer_range RandVertexList; - typedef typename boost::ct_if_t::type VertexList; typedef typename VertexList::iterator vertex_iterator; @@ -2283,10 +2285,10 @@ namespace boost { typedef typename container_gen >::type EdgeContainer; - typedef typename ct_and::type >::type on_edge_storage; + typedef typename mpl::and_::type >::type on_edge_storage; - typedef typename boost::ct_if_t::type edges_size_type; @@ -2294,9 +2296,9 @@ namespace boost { typedef typename detail::is_random_access::type is_edge_ra; - typedef typename boost::ct_if_t, - typename boost::ct_if_t, stored_edge_iter >::type @@ -2347,7 +2349,7 @@ namespace boost { typedef adj_list_edge_iterator DirectedEdgeIter; - typedef typename boost::ct_if_t::type edge_iterator; // stored_vertex and StoredVertexList @@ -2381,10 +2383,10 @@ namespace boost { InEdgeList m_in_edges; VertexProperty m_property; }; - typedef typename boost::ct_if_t::type, - typename boost::ct_if_t::type >::type StoredVertex; struct stored_vertex : public StoredVertex { @@ -2394,20 +2396,20 @@ namespace boost { typedef typename container_gen::type RandStoredVertexList; - typedef typename boost::ct_if_t< is_rand_access, + typedef typename mpl::if_< is_rand_access, RandStoredVertexList, SeqStoredVertexList>::type StoredVertexList; }; // end of config - typedef typename boost::ct_if_t, - typename boost::ct_if_t, undirected_graph_helper >::type >::type DirectedHelper; - typedef typename boost::ct_if_t, adj_list_impl >::type type; diff --git a/include/boost/graph/detail/bitset.hpp b/include/boost/graph/detail/bitset.hpp index c6ebf223..743b591f 100644 --- a/include/boost/graph/detail/bitset.hpp +++ b/include/boost/graph/detail/bitset.hpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include // This provides versions of std::bitset with both static and dynamic size. @@ -594,7 +594,7 @@ namespace boost { typename Allocator = std::allocator > class bitset_generator { - typedef typename ct_if::type selector; public: typedef typename selector diff --git a/include/boost/graph/detail/is_same.hpp b/include/boost/graph/detail/is_same.hpp index cda8d561..8027a47a 100644 --- a/include/boost/graph/detail/is_same.hpp +++ b/include/boost/graph/detail/is_same.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_GRAPH_DETAIL_IS_SAME_HPP #define BOOST_GRAPH_DETAIL_IS_SAME_HPP -#include +#include namespace boost { struct false_tag; @@ -30,7 +30,7 @@ namespace boost { template struct is_same { enum { Unum = U::num, Vnum = V::num }; - typedef typename boost::ct_if< (Unum == Vnum), + typedef typename mpl::if_c< (Unum == Vnum), boost::true_tag, boost::false_tag>::type is_same_tag; }; #endif diff --git a/include/boost/graph/edge_list.hpp b/include/boost/graph/edge_list.hpp index 46fdde69..32c5c259 100644 --- a/include/boost/graph/edge_list.hpp +++ b/include/boost/graph/edge_list.hpp @@ -13,7 +13,8 @@ #include #include -#include +#include +#include #include #include #include @@ -241,11 +242,11 @@ namespace boost { template struct is_random { enum { RET = false }; - typedef false_type type; + typedef mpl::false_ type; }; template <> struct is_random { - enum { RET = true }; typedef true_type type; + enum { RET = true }; typedef mpl::true_ type; }; // The edge_list class conditionally inherits from one of the @@ -262,7 +263,7 @@ namespace boost { class Cat> #endif class edge_list - : public ct_if_t< typename is_random::type, + : public mpl::if_< typename is_random::type, edge_list_impl_ra< edge_list, EdgeIter,T,D>, edge_list_impl< edge_list, EdgeIter,T,D> >::type diff --git a/include/boost/graph/graph_selectors.hpp b/include/boost/graph/graph_selectors.hpp index a3223c9b..777ebefc 100644 --- a/include/boost/graph/graph_selectors.hpp +++ b/include/boost/graph/graph_selectors.hpp @@ -10,6 +10,8 @@ #ifndef BOOST_GRAPH_SELECTORS_HPP #define BOOST_GRAPH_SELECTORS_HPP +#include + namespace boost { //=========================================================================== @@ -17,18 +19,18 @@ namespace boost { // and adjacency_matrix. struct directedS { enum { is_directed = true, is_bidir = false }; - typedef true_type is_directed_t; - typedef false_type is_bidir_t; + typedef mpl::true_ is_directed_t; + typedef mpl::false_ is_bidir_t; }; struct undirectedS { enum { is_directed = false, is_bidir = false }; - typedef false_type is_directed_t; - typedef false_type is_bidir_t; + typedef mpl::false_ is_directed_t; + typedef mpl::false_ is_bidir_t; }; struct bidirectionalS { enum { is_directed = true, is_bidir = true }; - typedef true_type is_directed_t; - typedef true_type is_bidir_t; + typedef mpl::true_ is_directed_t; + typedef mpl::true_ is_bidir_t; }; } // namespace boost diff --git a/include/boost/graph/johnson_all_pairs_shortest.hpp b/include/boost/graph/johnson_all_pairs_shortest.hpp index 5a89e033..45a8cf2c 100644 --- a/include/boost/graph/johnson_all_pairs_shortest.hpp +++ b/include/boost/graph/johnson_all_pairs_shortest.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include namespace boost { diff --git a/include/boost/graph/properties.hpp b/include/boost/graph/properties.hpp index 7133771c..e3816e36 100644 --- a/include/boost/graph/properties.hpp +++ b/include/boost/graph/properties.hpp @@ -361,11 +361,11 @@ namespace boost { typedef graph_traits traits; typedef typename Graph::vertex_bundled vertex_bundled; typedef typename Graph::edge_bundled edge_bundled; - typedef typename ct_if<(detail::is_vertex_bundle::value), + typedef typename mpl::if_c<(detail::is_vertex_bundle::value), typename traits::vertex_descriptor, typename traits::edge_descriptor>::type descriptor; - typedef typename ct_if<(detail::is_vertex_bundle::value), + typedef typename mpl::if_c<(detail::is_vertex_bundle::value), vertex_bundled, edge_bundled>::type actual_bundle; diff --git a/include/boost/graph/property_iter_range.hpp b/include/boost/graph/property_iter_range.hpp index 1e93c384..69ff7f00 100644 --- a/include/boost/graph/property_iter_range.hpp +++ b/include/boost/graph/property_iter_range.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include namespace boost { @@ -34,7 +34,7 @@ namespace boost { typedef typename property_map::const_type const_map_type; typedef typename property_kind::type Kind; - typedef typename ct_if::value, + typedef typename mpl::if_c::value, typename graph_traits::vertex_iterator, typename graph_traits::edge_iterator>::type iter; public: