Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:14

0001 /*=============================================================================
0002     Copyright (c) 2016 Paul Fultz II
0003     result_type.hpp
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 
0008 #ifndef BOOST_HOF_GUARD_RESULT_TYPE_HPP
0009 #define BOOST_HOF_GUARD_RESULT_TYPE_HPP
0010 
0011 #include <boost/hof/detail/holder.hpp>
0012 #include <utility>
0013 
0014 namespace boost { namespace hof { namespace detail {
0015 
0016 template<class F, class=void>
0017 struct function_result_type
0018 {};
0019 
0020 template<class F>
0021 struct function_result_type<F, typename holder<
0022     typename F::result_type
0023 >::type>
0024 {
0025     typedef typename F::result_type result_type;
0026 };
0027 
0028 template<class F, class G, class=void>
0029 struct compose_function_result_type
0030 : function_result_type<F>
0031 {};
0032 
0033 template<class F, class G>
0034 struct compose_function_result_type<F, G, typename holder<
0035     decltype(std::declval<F>()(std::declval<typename G::result_type>()))
0036 >::type>
0037 {
0038     typedef decltype(std::declval<F>()(std::declval<typename G::result_type>())) result_type;
0039 };
0040 
0041 }}} // namespace boost::hof
0042 
0043 #endif