Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright Daniel Wallin 2006.
0002 // Copyright Cromwell D. Enage 2017.
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
0008 #define BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
0009 
0010 namespace boost { namespace parameter { namespace aux {
0011 
0012     struct template_keyword_base
0013     {
0014     };
0015 }}} // namespace boost::parameter::aux
0016 
0017 #include <boost/parameter/config.hpp>
0018 
0019 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0020 #include <type_traits>
0021 
0022 namespace boost { namespace parameter { namespace aux {
0023 
0024     template <typename T>
0025     using is_template_keyword = ::std::is_base_of<
0026         ::boost::parameter::aux::template_keyword_base
0027       , typename ::std::remove_const<
0028             typename ::std::remove_reference<T>::type
0029         >::type
0030     >;
0031 }}} // namespace boost::parameter::aux
0032 
0033 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0034 #include <boost/mpl/bool.hpp>
0035 #include <boost/mpl/if.hpp>
0036 #include <boost/type_traits/remove_const.hpp>
0037 
0038 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0039 #include <boost/type_traits/is_base_of.hpp>
0040 #include <boost/type_traits/remove_reference.hpp>
0041 #else
0042 #include <boost/type_traits/is_convertible.hpp>
0043 #include <boost/type_traits/is_lvalue_reference.hpp>
0044 #endif
0045 
0046 namespace boost { namespace parameter { namespace aux {
0047 
0048 #if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0049     template <typename T>
0050     struct is_template_keyword_aux
0051       : ::boost::mpl::if_<
0052             ::boost::is_convertible<
0053                 T*
0054               , ::boost::parameter::aux::template_keyword_base const*
0055             >
0056           , ::boost::mpl::true_
0057           , ::boost::mpl::false_
0058         >::type
0059     {
0060     };
0061 #endif  // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
0062 
0063     template <typename T>
0064     struct is_template_keyword
0065       : ::boost::mpl::if_<
0066 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0067             // Cannot use is_convertible<> to check if T is derived from
0068             // template_keyword_base. -- Cromwell D. Enage
0069             ::boost::is_base_of<
0070                 ::boost::parameter::aux::template_keyword_base
0071               , typename ::boost::remove_const<
0072                     typename ::boost::remove_reference<T>::type
0073                 >::type
0074             >
0075           , ::boost::mpl::true_
0076           , ::boost::mpl::false_
0077 #else
0078             ::boost::is_lvalue_reference<T>
0079           , ::boost::mpl::false_
0080           , ::boost::parameter::aux::is_template_keyword_aux<T>
0081 #endif  // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
0082         >::type
0083     {
0084     };
0085 }}} // namespace boost::parameter::aux
0086 
0087 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0088 #endif  // include guard
0089