Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:26

0001 // Copyright David Abrahams, Daniel Wallin 2003.
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // (See accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
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     // helper for get_predicate<...>, below
0012     template <typename T>
0013     struct get_predicate_or_default
0014     {
0015         typedef T type;
0016     };
0017 
0018     // helper for predicate<...>, below
0019     template <typename T>
0020     struct get_predicate
0021       : ::boost::parameter::aux
0022         ::get_predicate_or_default<typename T::predicate>
0023     {
0024     };
0025 }}} // namespace boost::parameter::aux
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 }}} // namespace boost::parameter::aux
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  // BOOST_PARAMETER_CAN_USE_MP11
0084 }}} // namespace boost::parameter::aux
0085 
0086 #endif  // include guard
0087