PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/graph/overloading.hpp

http://hadesmem.googlecode.com/
C++ Header | 46 lines | 22 code | 14 blank | 10 comment | 0 complexity | a260403814367ce94f2d0b72f8687d78 MD5 | raw file
 1// Copyright 2004 The Trustees of Indiana University.
 2
 3// Use, modification and distribution is subject to the Boost Software
 4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 5// http://www.boost.org/LICENSE_1_0.txt)
 6
 7//  Authors: Douglas Gregor
 8//           Andrew Lumsdaine
 9
10//
11// This file contains helps that enable concept-based overloading
12// within the Boost Graph Library.
13//
14#ifndef BOOST_GRAPH_OVERLOADING_HPP
15#define BOOST_GRAPH_OVERLOADING_HPP
16
17#include <boost/type_traits/is_base_and_derived.hpp>
18#include <boost/utility/enable_if.hpp>
19
20namespace boost {  namespace graph { namespace detail {
21
22struct no_parameter {};
23
24} } } // end namespace boost::graph::detail
25
26#ifndef BOOST_NO_SFINAE
27
28#define BOOST_GRAPH_ENABLE_IF_MODELS(Graph, Tag, Type)               \
29  typename enable_if_c<(is_base_and_derived<                         \
30                          Tag,                                       \
31                          typename graph_traits<Graph>::traversal_category>::value), \
32                       Type>::type
33
34#define BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph, Tag)                   \
35  , BOOST_GRAPH_ENABLE_IF_MODELS(Graph, Tag,                            \
36                                 ::boost::graph::detail::no_parameter)  \
37    = ::boost::graph::detail::no_parameter()
38
39#else
40
41#define BOOST_GRAPH_ENABLE_IF_MODELS(Graph, Tag, Type) Type
42#define BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph, Tag)
43
44#endif // no SFINAE support
45
46#endif // BOOST_GRAPH_OVERLOADING_HPP