1 // Copyright Daniel Wallin 2006.
2 // Copyright Cromwell D. Enage 2017.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
8 #define BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
10 namespace boost { namespace parameter { namespace aux {
12 struct template_keyword_base
15 }}} // namespace boost::parameter::aux
17 #include <boost/parameter/config.hpp>
19 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
20 #include <type_traits>
22 namespace boost { namespace parameter { namespace aux {
25 using is_template_keyword = ::std::is_base_of<
26 ::boost::parameter::aux::template_keyword_base
27 , typename ::std::remove_const<
28 typename ::std::remove_reference<T>::type
31 }}} // namespace boost::parameter::aux
33 #else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
34 #include <boost/mpl/bool.hpp>
35 #include <boost/mpl/if.hpp>
36 #include <boost/type_traits/remove_const.hpp>
38 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
39 #include <boost/type_traits/is_base_of.hpp>
40 #include <boost/type_traits/remove_reference.hpp>
42 #include <boost/type_traits/is_convertible.hpp>
43 #include <boost/type_traits/is_lvalue_reference.hpp>
46 namespace boost { namespace parameter { namespace aux {
48 #if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
50 struct is_template_keyword_aux
52 ::boost::is_convertible<
54 , ::boost::parameter::aux::template_keyword_base const*
57 , ::boost::mpl::false_
61 #endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
64 struct is_template_keyword
66 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
67 // Cannot use is_convertible<> to check if T is derived from
68 // template_keyword_base. -- Cromwell D. Enage
70 ::boost::parameter::aux::template_keyword_base
71 , typename ::boost::remove_const<
72 typename ::boost::remove_reference<T>::type
76 , ::boost::mpl::false_
78 ::boost::is_lvalue_reference<T>
79 , ::boost::mpl::false_
80 , ::boost::parameter::aux::is_template_keyword_aux<T>
81 #endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
85 }}} // namespace boost::parameter::aux
87 #endif // BOOST_PARAMETER_CAN_USE_MP11
88 #endif // include guard