1 // Copyright David Abrahams, Daniel Wallin 2003.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_PARAMETER_OPTIONAL_HPP
7 #define BOOST_PARAMETER_OPTIONAL_HPP
9 #include <boost/parameter/aux_/use_default.hpp>
11 namespace boost { namespace parameter {
13 // This metafunction can be used to describe the treatment of particular
14 // named parameters for the purposes of overload elimination with SFINAE,
15 // by placing specializations in the parameters<...> list. In order for
16 // a treated function to participate in overload resolution:
18 // - The actual argument type matched by every keyword tag
19 // associated with a predicate must satisfy that predicate
21 // - If a keyword k is specified without an optional<...> or
22 // required<...> wrapper, it is treated as though
23 // optional<k> were specified.
26 , typename Predicate = ::boost::parameter::aux::use_default
31 typedef Predicate predicate;
35 #include <boost/parameter/config.hpp>
37 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
38 #include <boost/mp11/integral.hpp>
40 #include <boost/mpl/bool.hpp>
43 namespace boost { namespace parameter { namespace aux {
47 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
48 : ::boost::mp11::mp_false
50 : ::boost::mpl::false_
55 template <typename Tag, typename Predicate>
56 struct is_optional< ::boost::parameter::optional<Tag,Predicate> >
57 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
58 : ::boost::mp11::mp_true
64 }}} // namespace boost::parameter::aux
66 #endif // include guard