// Copyright David Abrahams, Daniel Wallin 2003. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP #define BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP #include #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) #include #include #include #include #include #include #else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310) #if defined(BOOST_PARAMETER_CAN_USE_MP11) #include #else #include #endif #include #include #endif // MSVC-7.1 workarounds needed namespace boost { namespace parameter { namespace aux { #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) template struct satisfies_impl : ::boost::parameter::aux::augment_predicate< typename ParameterRequirements::predicate , typename ArgList::reference , typename ArgList::key_type , Bound , ArgList > { }; #endif // Returns mpl::true_ iff the given ParameterRequirements are satisfied by // ArgList. template #if defined(BOOST_PARAMETER_CAN_USE_MP11) using satisfies = ::boost::mp11::mp_bool< sizeof( ::boost::parameter::aux::to_yesno( ArgList::satisfies( static_cast( BOOST_PARAMETER_AUX_PP_NULLPTR ) , static_cast(BOOST_PARAMETER_AUX_PP_NULLPTR) ) ) ) == sizeof(::boost::parameter::aux::yes_tag) >; #else // !defined(BOOST_PARAMETER_CAN_USE_MP11) class satisfies { #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) // VC7.1 can't handle the sizeof() implementation below, // so we use this instead. typedef typename ::boost::mpl::apply_wrap3< typename ArgList::binding , typename ParameterRequirements::keyword , ::boost::parameter::void_ , ::boost::mpl::false_ >::type _bound; public: typedef typename ::boost::mpl::eval_if< ::boost::is_same<_bound,::boost::parameter::void_> , typename ParameterRequirements::has_default , ::boost::mpl::eval_if< ::boost::is_same< ArgList , ::boost::parameter::aux::empty_arg_list > , ::boost::mpl::false_ , ::boost::parameter::aux::satisfies_impl< ArgList , ParameterRequirements , _bound > > >::type type; #else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310) BOOST_STATIC_CONSTANT( bool, _value = ( sizeof( ::boost::parameter::aux::to_yesno( ArgList::satisfies( static_cast( BOOST_PARAMETER_AUX_PP_NULLPTR ) , static_cast(BOOST_PARAMETER_AUX_PP_NULLPTR) ) ) ) == sizeof(::boost::parameter::aux::yes_tag) ) ); public: typedef ::boost::mpl::bool_< ::boost::parameter::aux ::satisfies::_value > type; #endif // MSVC-7.1 workarounds needed }; #endif // BOOST_PARAMETER_CAN_USE_MP11 }}} // namespace boost::parameter::aux #include namespace boost { namespace parameter { namespace aux { // Returns mpl::true_ if the requirements of the given ParameterSpec // are satisfied by ArgList. template #if defined(BOOST_PARAMETER_CAN_USE_MP11) using satisfies_requirements_of = ::boost::parameter::aux::satisfies< ArgList , typename ::boost::parameter::aux ::as_parameter_requirements::type >; #else struct satisfies_requirements_of : ::boost::parameter::aux::satisfies< ArgList , typename ::boost::parameter::aux ::as_parameter_requirements::type >::type { }; #endif // BOOST_PARAMETER_CAN_USE_MP11 }}} // namespace boost::parameter::aux #endif // include guard