File indexing completed on 2025-01-18 09:43:26
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
0007 #define BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
0008
0009 namespace boost { namespace parameter { namespace aux {
0010
0011
0012 template <typename T>
0013 struct get_predicate_or_default
0014 {
0015 typedef T type;
0016 };
0017
0018
0019 template <typename T>
0020 struct get_predicate
0021 : ::boost::parameter::aux
0022 ::get_predicate_or_default<typename T::predicate>
0023 {
0024 };
0025 }}}
0026
0027 #include <boost/parameter/aux_/use_default.hpp>
0028 #include <boost/parameter/aux_/always_true_predicate.hpp>
0029
0030 namespace boost { namespace parameter { namespace aux {
0031
0032 template <>
0033 struct get_predicate_or_default< ::boost::parameter::aux::use_default>
0034 {
0035 typedef ::boost::parameter::aux::always_true_predicate type;
0036 };
0037 }}}
0038
0039 #include <boost/parameter/required.hpp>
0040 #include <boost/parameter/optional.hpp>
0041 #include <boost/parameter/config.hpp>
0042
0043 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0044 #include <boost/mp11/integral.hpp>
0045 #include <boost/mp11/utility.hpp>
0046 #else
0047 #include <boost/mpl/bool.hpp>
0048 #include <boost/mpl/if.hpp>
0049 #include <boost/mpl/eval_if.hpp>
0050 #include <boost/mpl/identity.hpp>
0051 #endif
0052
0053 namespace boost { namespace parameter { namespace aux {
0054
0055 template <typename T>
0056 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0057 using predicate = ::boost::mp11::mp_if<
0058 ::boost::mp11::mp_if<
0059 ::boost::parameter::aux::is_optional<T>
0060 , ::boost::mp11::mp_true
0061 , ::boost::parameter::aux::is_required<T>
0062 >
0063 , ::boost::parameter::aux::get_predicate<T>
0064 , ::boost::mp11::mp_identity<
0065 ::boost::parameter::aux::always_true_predicate
0066 >
0067 >;
0068 #else
0069 struct predicate
0070 : ::boost::mpl::eval_if<
0071 typename ::boost::mpl::if_<
0072 ::boost::parameter::aux::is_optional<T>
0073 , ::boost::mpl::true_
0074 , ::boost::parameter::aux::is_required<T>
0075 >::type
0076 , ::boost::parameter::aux::get_predicate<T>
0077 , ::boost::mpl::identity<
0078 ::boost::parameter::aux::always_true_predicate
0079 >
0080 >
0081 {
0082 };
0083 #endif
0084 }}}
0085
0086 #endif
0087