1 // Copyright Cromwell D. Enage 2019.
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_AUX_HAS_NESTED_TEMPLATE_FN_HPP
7 #define BOOST_PARAMETER_AUX_HAS_NESTED_TEMPLATE_FN_HPP
9 #include <boost/parameter/aux_/yesno.hpp>
10 #include <boost/parameter/aux_/preprocessor/nullptr.hpp>
11 #include <boost/parameter/config.hpp>
13 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
14 #include <boost/mp11/integral.hpp>
15 #include <boost/mp11/utility.hpp>
17 #include <boost/mpl/bool.hpp>
18 #include <boost/mpl/identity.hpp>
21 namespace boost { namespace parameter { namespace aux {
23 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
24 template <template <typename ...> class F>
25 struct has_nested_template_fn_variadic
29 template <template <typename P0, typename P1> class F>
30 struct has_nested_template_fn_arity_2
36 class has_nested_template_fn_impl
39 static ::boost::parameter::aux::no_tag _check(...);
41 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
43 static ::boost::parameter::aux::yes_tag
45 ::boost::mp11::mp_identity<U> const volatile*
46 , ::boost::parameter::aux::has_nested_template_fn_variadic<
48 >* = BOOST_PARAMETER_AUX_PP_NULLPTR
52 static BOOST_CONSTEXPR ::boost::parameter::aux::yes_tag
54 ::boost::mpl::identity<U> const volatile*
55 , ::boost::parameter::aux::has_nested_template_fn_arity_2<
57 >* = BOOST_PARAMETER_AUX_PP_NULLPTR
62 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
63 using type = ::boost::mp11::mp_bool<
65 typedef ::boost::mpl::bool_<
68 ::boost::parameter::aux::has_nested_template_fn_impl<T>
71 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
72 ::boost::mp11::mp_identity<T> const volatile*
74 ::boost::mpl::identity<T> const volatile*
76 >(BOOST_PARAMETER_AUX_PP_NULLPTR)
78 ) == sizeof(::boost::parameter::aux::yes_tag)
79 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
85 }}} // namespace boost::parameter::aux
87 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
88 #include <type_traits>
90 #include <boost/type_traits/remove_const.hpp>
93 namespace boost { namespace parameter { namespace aux {
96 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
97 using has_nested_template_fn = typename ::boost::parameter::aux
98 ::has_nested_template_fn_impl<typename ::std::remove_const<T>::type>
101 struct has_nested_template_fn
102 : ::boost::parameter::aux::has_nested_template_fn_impl<
103 typename ::boost::remove_const<T>::type
108 }}} // namespace boost::parameter::aux
110 #endif // include guard