1 // Copyright David Abrahams 2005. Distributed under the Boost
2 // Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4 #ifndef BOOST_PARAMETER_BINDING_DWA200558_HPP
5 # define BOOST_PARAMETER_BINDING_DWA200558_HPP
7 # include <boost/mpl/apply.hpp>
8 # include <boost/parameter/aux_/result_of0.hpp>
10 # include <boost/parameter/aux_/void.hpp>
12 # if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
13 # include <boost/parameter/aux_/void.hpp>
14 # include <boost/type_traits/is_same.hpp>
17 namespace boost { namespace parameter {
19 // A metafunction that, given an argument pack, returns the type of
20 // the parameter identified by the given keyword. If no such
21 // parameter has been specified, returns Default
22 # if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
23 template <class Parameters, class Keyword, class Default = void>
26 typename Parameters::binding,Keyword,Default
30 template <class Parameters, class Keyword, class Default = aux::void_>
33 typedef typename mpl::apply_wrap2<
34 typename Parameters::binding,Keyword,
35 typename mpl::if_<is_same<Default,aux::void_>,void,Default>::type
40 // A metafunction that, given an argument pack, returns the type of
41 // the parameter identified by the given keyword. If no such
42 // parameter has been specified, returns the type returned by invoking
44 template <class Parameters, class Keyword, class DefaultFn>
47 typedef typename mpl::apply_wrap2<
48 typename Parameters::binding
50 , typename aux::result_of0<DefaultFn>::type
55 }} // namespace boost::parameter
57 #endif // BOOST_PARAMETER_BINDING_DWA200558_HPP