// Copyright Daniel Wallin 2006. // 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_PP_IMPL_UNWRAP_PREDICATE_HPP #define BOOST_PARAMETER_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP namespace boost { namespace parameter { namespace aux { // Given Match, which is "void x" where x is an argument matching // criterion, extract a corresponding MPL predicate. template struct unwrap_predicate; }}} // namespace boost::parameter::aux #include namespace boost { namespace parameter { namespace aux { // Match anything template <> struct unwrap_predicate { typedef ::boost::parameter::aux::always_true_predicate type; }; }}} // namespace boost::parameter::aux #include #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) #include #endif namespace boost { namespace parameter { namespace aux { // A matching predicate is explicitly specified. #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580)) template struct unwrap_predicate< ::boost::parameter::aux::voidstar(Predicate)> { typedef Predicate type; }; #else template struct unwrap_predicate { typedef Predicate type; }; #endif // SunProCC workarounds needed. }}} // namespace boost::parameter::aux #include #include #if defined(BOOST_PARAMETER_CAN_USE_MP11) #include #else #include #include #endif namespace boost { namespace parameter { namespace aux { // A type to which the argument is supposed to be convertible is // specified. template struct unwrap_predicate { #if defined(BOOST_PARAMETER_CAN_USE_MP11) struct type { template struct apply : ::boost::mpl::if_< ::std::is_convertible , ::boost::mpl::true_ , ::boost::mpl::false_ > { }; template using fn = ::std::is_convertible; }; #else typedef ::boost::mpl::if_< ::boost::is_convertible< ::boost::mpl::_,Target> , ::boost::mpl::true_ , ::boost::mpl::false_ > type; #endif // BOOST_PARAMETER_CAN_USE_MP11 }; }}} // namespace boost::parameter::aux #endif // include guard