Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:20:38

0001 // Copyright Cromwell D. Enage 2019.
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_HAS_NESTED_TEMPLATE_FN_HPP
0007 #define BOOST_PARAMETER_AUX_HAS_NESTED_TEMPLATE_FN_HPP
0008 
0009 #include <boost/parameter/aux_/yesno.hpp>
0010 #include <boost/parameter/aux_/preprocessor/nullptr.hpp>
0011 #include <boost/parameter/config.hpp>
0012 
0013 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0014 #include <boost/mp11/integral.hpp>
0015 #include <boost/mp11/utility.hpp>
0016 #else
0017 #include <boost/mpl/bool.hpp>
0018 #include <boost/mpl/identity.hpp>
0019 #endif
0020 
0021 namespace boost { namespace parameter { namespace aux {
0022 
0023 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0024     template <template <typename ...> class F>
0025     struct has_nested_template_fn_variadic
0026     {
0027     };
0028 #else
0029     template <template <typename P0, typename P1> class F>
0030     struct has_nested_template_fn_arity_2
0031     {
0032     };
0033 #endif
0034 
0035     template <typename T>
0036     class has_nested_template_fn_impl
0037     {
0038         template <typename U>
0039         static ::boost::parameter::aux::no_tag _check(...);
0040 
0041 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0042         template <typename U>
0043         static ::boost::parameter::aux::yes_tag
0044             _check(
0045                 ::boost::mp11::mp_identity<U> const volatile*
0046               , ::boost::parameter::aux::has_nested_template_fn_variadic<
0047                     U::template fn
0048                 >* = BOOST_PARAMETER_AUX_PP_NULLPTR
0049             );
0050 #else
0051         template <typename U>
0052         static BOOST_CONSTEXPR ::boost::parameter::aux::yes_tag
0053             _check(
0054                 ::boost::mpl::identity<U> const volatile*
0055               , ::boost::parameter::aux::has_nested_template_fn_arity_2<
0056                     U::template fn
0057                 >* = BOOST_PARAMETER_AUX_PP_NULLPTR
0058             );
0059 #endif
0060 
0061      public:
0062 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0063         using type = ::boost::mp11::mp_bool<
0064 #else
0065         typedef ::boost::mpl::bool_<
0066 #endif
0067             sizeof(
0068                 ::boost::parameter::aux::has_nested_template_fn_impl<T>
0069                 ::template _check<T>(
0070                     static_cast<
0071 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0072                         ::boost::mp11::mp_identity<T> const volatile*
0073 #else
0074                         ::boost::mpl::identity<T> const volatile*
0075 #endif
0076                     >(BOOST_PARAMETER_AUX_PP_NULLPTR)
0077                 )
0078             ) == sizeof(::boost::parameter::aux::yes_tag)
0079 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0080         >;
0081 #else
0082         > type;
0083 #endif
0084     };
0085 }}} // namespace boost::parameter::aux
0086 
0087 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0088 #include <type_traits>
0089 #else
0090 #include <boost/type_traits/remove_const.hpp>
0091 #endif
0092 
0093 namespace boost { namespace parameter { namespace aux {
0094 
0095     template <typename T>
0096 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0097     using has_nested_template_fn = typename ::boost::parameter::aux
0098     ::has_nested_template_fn_impl<typename ::std::remove_const<T>::type>
0099     ::type;
0100 #else
0101     struct has_nested_template_fn
0102       : ::boost::parameter::aux::has_nested_template_fn_impl<
0103             typename ::boost::remove_const<T>::type
0104         >::type
0105     {
0106     };
0107 #endif
0108 }}} // namespace boost::parameter::aux
0109 
0110 #endif  // include guard
0111