1 //-----------------------------------------------------------------------------
2 // boost variant/detail/has_result_type.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
6 // Copyright (c) 2014-2019 Antony Polukhin
8 // Distributed under the Boost Software License, Version 1.0. (See
9 // accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 #ifndef BOOST_VARIANT_DETAIL_HAS_RESULT_TYPE_HPP
13 #define BOOST_VARIANT_DETAIL_HAS_RESULT_TYPE_HPP
15 #include <boost/config.hpp>
16 #include <boost/type_traits/remove_reference.hpp>
19 namespace boost { namespace detail { namespace variant {
21 template <typename T >
22 struct has_result_type {
25 typedef struct { char array[2]; } no;
27 template<typename C> static yes test(typename boost::remove_reference<typename C::result_type>::type*);
28 template<typename C> static no test(...);
31 BOOST_STATIC_CONSTANT(bool, value = sizeof(test<T>(0)) == sizeof(yes));
34 }}} // namespace boost::detail::variant
36 #endif // BOOST_VARIANT_DETAIL_HAS_RESULT_TYPE_HPP