/* @Copyright Barrett Adair 2015-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_CLBL_TRTS_RESULT_OF_HPP #define BOOST_CLBL_TRTS_RESULT_OF_HPP #include namespace boost { namespace callable_traits { BOOST_CLBL_TRTS_DEFINE_SFINAE_ERROR_ORIGIN(return_type) BOOST_CLBL_TRTS_SFINAE_MSG(return_type, unable_to_determine_return_type) //[ return_type_hpp /*` [section:ref_return_type return_type] [heading Header] ``#include `` [heading Definition] */ template using return_type_t = //see below //<- detail::try_but_fail_if_invalid< typename detail::traits>::return_type, unable_to_determine_return_type>; namespace detail { template struct return_type_impl {}; template struct return_type_impl , detail::dummy>::type> { using type = return_type_t; }; } //-> template struct return_type : detail::return_type_impl {}; //<- }} // namespace boost::callable_traits //-> /*` [heading Constraints] * `T` must be one of the following: * function * function pointer * function reference * member function pointer * member data pointer * user-defined type with a non-overloaded `operator()` * type of a non-generic lambda [heading Behavior] * When the constraints are violated, a substitution failure occurs. * The aliased type is the return type of `T`. [heading Input/Output Examples] [table [[`T`] [`return_type_t`]] [[`void()`] [`void`]] [[`float(*)()`] [`float`]] [[`const char*(&)()`] [`const char *`]] [[`int(foo::*)() const`] [`int`]] [[`int`] [(substitution failure)]] [[`int (*const)()`] [(substitution failure)]] ] [heading Example Program] [import ../example/return_type.cpp] [return_type] [endsect] */ //] #endif // #ifndef BOOST_CLBL_TRTS_RESULT_OF_HPP