1 // Copyright David Abrahams 2005.
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_RESULT_OF0_DWA2005511_HPP
7 #define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
9 #include <boost/parameter/aux_/use_default_tag.hpp>
10 #include <boost/parameter/config.hpp>
11 #include <boost/utility/result_of.hpp>
13 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
14 #include <boost/mp11/utility.hpp>
15 #include <type_traits>
17 #include <boost/mpl/if.hpp>
18 #include <boost/type_traits/is_void.hpp>
21 namespace boost { namespace parameter { namespace aux {
23 // A metafunction returning the result of invoking
24 // a nullary function object of the given type.
28 #if defined(BOOST_NO_RESULT_OF)
29 typedef typename F::result_type result_of_F;
31 typedef typename ::boost::result_of<F()>::type result_of_F;
35 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
36 using type = ::boost::mp11::mp_if<
37 ::std::is_void<result_of_F>
39 typedef typename ::boost::mpl::if_<
40 ::boost::is_void<result_of_F>
42 , ::boost::parameter::aux::use_default_tag
44 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
50 }}} // namespace boost::parameter::aux
52 #endif // include guard