1 // Copyright Frank Mori Hess 2009.
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 #include <boost/parameter/template_keyword.hpp>
8 #include <boost/parameter/parameters.hpp>
9 #include <boost/parameter/required.hpp>
10 #include <boost/parameter/value_type.hpp>
11 #include <boost/parameter/config.hpp>
13 #if defined(BOOST_PARAMETER_CAN_USE_MP11) && \
14 BOOST_WORKAROUND(BOOST_MSVC, < 1920)
15 #include <type_traits>
17 #include <boost/mpl/bool.hpp>
18 #include <boost/mpl/if.hpp>
19 #include <boost/type_traits/is_same.hpp>
25 BOOST_PARAMETER_TEMPLATE_KEYWORD(function_type
)
26 } // namespace keywords
28 template <typename K
, typename A
>
29 #if BOOST_WORKAROUND(BOOST_MSVC, < 1920)
30 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
31 using X
= boost::parameter::value_type
<
34 : boost::parameter::value_type
<
36 typename
boost::parameter::parameters
<
37 boost::parameter::required
<K
>
38 >::BOOST_NESTED_TEMPLATE bind
<A
>::type
40 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
50 typedef typename
boost::parameter::value_type
<
51 typename
boost::parameter::parameters
<
52 boost::parameter::required
<K
>
53 >::BOOST_NESTED_TEMPLATE bind
<A
>::type
60 #if BOOST_WORKAROUND(BOOST_MSVC, < 1920)
61 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
62 using Y
= std::is_same
<
70 test::keywords::tag::function_type
71 , test::keywords::function_type
<T
>
73 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
86 typedef typename
boost::mpl::if_
<
90 test::keywords::tag::function_type
91 , test::keywords::function_type
<T
>
102 int operator()() const
109 #include <boost/mpl/aux_/test.hpp>
111 #if !defined(BOOST_PARAMETER_CAN_USE_MP11) || \
112 BOOST_WORKAROUND(BOOST_MSVC, >= 1920)
113 #include <boost/mpl/assert.hpp>
118 #if BOOST_WORKAROUND(BOOST_MSVC, < 1920)
119 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
120 static_assert(test::Y
<void()>::value
, "void()");
121 static_assert(test::Y
<test::Z
>::value
, "test::Z");
122 static_assert(test::Y
<double(double)>::value
, "double(double)");
124 BOOST_MPL_ASSERT((test::Y
<void()>));
125 BOOST_MPL_ASSERT((test::Y
<test::Z
>));
126 BOOST_MPL_ASSERT((test::Y
<double(double)>));
129 BOOST_MPL_ASSERT((test::Y
<void()>::type
));
130 BOOST_MPL_ASSERT((test::Y
<test::Z
>::type
));
131 BOOST_MPL_ASSERT((test::Y
<double(double)>::type
));