Chris@16: // Copyright David Abrahams 2005. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef BOOST_PARAMETER_BINDING_DWA200558_HPP Chris@16: # define BOOST_PARAMETER_BINDING_DWA200558_HPP Chris@16: Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: # include Chris@16: Chris@16: # if BOOST_WORKAROUND(BOOST_MSVC, < 1300) Chris@16: # include Chris@16: # endif Chris@16: Chris@16: namespace boost { namespace parameter { Chris@16: Chris@16: // A metafunction that, given an argument pack, returns the type of Chris@16: // the parameter identified by the given keyword. If no such Chris@16: // parameter has been specified, returns Default Chris@16: Chris@16: # if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ Chris@16: || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) Chris@16: template Chris@16: struct binding0 Chris@16: { Chris@16: typedef typename mpl::apply_wrap3< Chris@16: typename Parameters::binding,Keyword,Default,mpl::true_ Chris@16: >::type type; Chris@16: Chris@16: BOOST_MPL_ASSERT_NOT(( Chris@16: mpl::and_< Chris@16: is_same Chris@16: , is_same Chris@16: > Chris@16: )); Chris@16: }; Chris@16: # endif Chris@16: Chris@16: template Chris@16: # if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) Chris@16: struct binding Chris@16: # else Chris@16: struct binding_eti Chris@16: # endif Chris@16: { Chris@16: # if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ Chris@16: || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) Chris@16: typedef typename mpl::eval_if< Chris@16: mpl::is_placeholder Chris@16: , mpl::identity Chris@16: , binding0 Chris@16: >::type type; Chris@16: # else Chris@16: typedef typename mpl::apply_wrap3< Chris@16: typename Parameters::binding,Keyword,Default,mpl::true_ Chris@16: >::type type; Chris@16: Chris@16: BOOST_MPL_ASSERT_NOT(( Chris@16: mpl::and_< Chris@16: is_same Chris@16: , is_same Chris@16: > Chris@16: )); Chris@16: # endif Chris@16: Chris@16: # if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT(3,binding,(Parameters,Keyword,Default)) Chris@16: # endif Chris@16: }; Chris@16: Chris@16: # if BOOST_WORKAROUND(BOOST_MSVC, < 1300) Chris@16: template Chris@16: struct binding Chris@16: { Chris@16: typedef typename mpl::eval_if< Chris@16: is_same Chris@16: , mpl::identity Chris@16: , binding_eti Chris@16: >::type type; Chris@16: Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT(3,binding,(Parameters,Keyword,Default)) Chris@16: }; Chris@16: # endif Chris@16: Chris@16: // A metafunction that, given an argument pack, returns the type of Chris@16: // the parameter identified by the given keyword. If no such Chris@16: // parameter has been specified, returns the type returned by invoking Chris@16: // DefaultFn Chris@16: template Chris@16: struct lazy_binding Chris@16: { Chris@16: typedef typename mpl::apply_wrap3< Chris@16: typename Parameters::binding Chris@16: , Keyword Chris@16: , typename aux::result_of0::type Chris@16: , mpl::true_ Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: Chris@16: }} // namespace boost::parameter Chris@16: Chris@16: #endif // BOOST_PARAMETER_BINDING_DWA200558_HPP