| 1 | |
|---|---|
| 2 | // (C) Copyright Tobias Schwinger |
| 3 | // |
| 4 | // Use modification and distribution are subject to the boost Software License, |
| 5 | // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt). |
| 6 | |
| 7 | //------------------------------------------------------------------------------ |
| 8 | |
| 9 | #ifndef BOOST_FT_RESULT_TYPE_HPP_INCLUDED |
| 10 | #define BOOST_FT_RESULT_TYPE_HPP_INCLUDED |
| 11 | |
| 12 | #include <boost/blank.hpp> |
| 13 | #include <boost/mpl/if.hpp> |
| 14 | |
| 15 | #include <boost/mpl/aux_/lambda_support.hpp> |
| 16 | |
| 17 | #include <boost/mpl/at.hpp> |
| 18 | |
| 19 | #include <boost/function_types/is_callable_builtin.hpp> |
| 20 | #include <boost/function_types/components.hpp> |
| 21 | |
| 22 | namespace boost |
| 23 | { |
| 24 | namespace function_types |
| 25 | { |
| 26 | template< typename T > struct result_type; |
| 27 | |
| 28 | namespace detail |
| 29 | { |
| 30 | template<typename T> struct result_type_impl |
| 31 | : mpl::at_c |
| 32 | < typename function_types::components<T>::types, 0 > |
| 33 | { }; |
| 34 | } |
| 35 | |
| 36 | template<typename T> struct result_type |
| 37 | : mpl::if_ |
| 38 | < function_types::is_callable_builtin<T> |
| 39 | , detail::result_type_impl<T>, boost::blank |
| 40 | >::type |
| 41 | { |
| 42 | BOOST_MPL_AUX_LAMBDA_SUPPORT(1,result_type,(T)) |
| 43 | }; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | #endif |
| 48 | |
| 49 |