Back to home page

EIC code displayed by LXR

 
 

    


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

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_OPTIONAL_HPP
0007 #define BOOST_PARAMETER_OPTIONAL_HPP
0008 
0009 #include <boost/parameter/aux_/use_default.hpp>
0010 
0011 namespace boost { namespace parameter {
0012 
0013     // This metafunction can be used to describe the treatment of particular
0014     // named parameters for the purposes of overload elimination with SFINAE,
0015     // by placing specializations in the parameters<...> list.  In order for
0016     // a treated function to participate in overload resolution:
0017     //
0018     //   - The actual argument type matched by every keyword tag
0019     //     associated with a predicate must satisfy that predicate
0020     //
0021     //   - If a keyword k is specified without an optional<...> or
0022     //     required<...> wrapper, it is treated as though
0023     //     optional<k> were specified.
0024     template <
0025         typename Tag
0026       , typename Predicate = ::boost::parameter::aux::use_default
0027     >
0028     struct optional
0029     {
0030         typedef Tag key_type;
0031         typedef Predicate predicate;
0032     };
0033 }}
0034 
0035 #include <boost/parameter/config.hpp>
0036 
0037 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0038 #include <boost/mp11/integral.hpp>
0039 #else
0040 #include <boost/mpl/bool.hpp>
0041 #endif
0042 
0043 namespace boost { namespace parameter { namespace aux {
0044 
0045     template <typename T>
0046     struct is_optional
0047 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0048       : ::boost::mp11::mp_false
0049 #else
0050       : ::boost::mpl::false_
0051 #endif
0052     {
0053     };
0054 
0055     template <typename Tag, typename Predicate>
0056     struct is_optional< ::boost::parameter::optional<Tag,Predicate> >
0057 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0058       : ::boost::mp11::mp_true
0059 #else
0060       : ::boost::mpl::true_
0061 #endif
0062     {
0063     };
0064 }}} // namespace boost::parameter::aux
0065 
0066 #endif  // include guard
0067