Chris@16: // Copyright 2004 The Trustees of Indiana University. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // Authors: Douglas Gregor Chris@16: // Andrew Lumsdaine Chris@16: Chris@16: // Chris@16: // This file contains helps that enable concept-based overloading Chris@16: // within the Boost Graph Library. Chris@16: // Chris@16: #ifndef BOOST_GRAPH_OVERLOADING_HPP Chris@16: #define BOOST_GRAPH_OVERLOADING_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace graph { namespace detail { Chris@16: Chris@16: struct no_parameter {}; Chris@16: Chris@16: } } } // end namespace boost::graph::detail Chris@16: Chris@16: #ifndef BOOST_NO_SFINAE Chris@16: Chris@16: #define BOOST_GRAPH_ENABLE_IF_MODELS(Graph, Tag, Type) \ Chris@16: typename enable_if_c<(is_base_and_derived< \ Chris@16: Tag, \ Chris@16: typename graph_traits::traversal_category>::value), \ Chris@16: Type>::type Chris@16: Chris@16: #define BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph, Tag) \ Chris@16: , BOOST_GRAPH_ENABLE_IF_MODELS(Graph, Tag, \ Chris@16: ::boost::graph::detail::no_parameter) \ Chris@16: = ::boost::graph::detail::no_parameter() Chris@16: Chris@16: #else Chris@16: Chris@16: #define BOOST_GRAPH_ENABLE_IF_MODELS(Graph, Tag, Type) Type Chris@16: #define BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph, Tag) Chris@16: Chris@16: #endif // no SFINAE support Chris@16: Chris@16: #endif // BOOST_GRAPH_OVERLOADING_HPP