Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:11

0001 #ifndef BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
0002 #define BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED
0003 
0004 // MS compatible compilers support #pragma once
0005 
0006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
0007 # pragma once
0008 #endif
0009 
0010 //
0011 //  bind/detail/result_traits.hpp
0012 //
0013 //  boost/bind.hpp support header, return type deduction
0014 //
0015 //  Copyright 2006, 2020 Peter Dimov
0016 //
0017 //  Distributed under the Boost Software License, Version 1.0.
0018 //  See accompanying file LICENSE_1_0.txt or copy at
0019 //  http://www.boost.org/LICENSE_1_0.txt
0020 //
0021 //  See http://www.boost.org/libs/bind/bind.html for documentation.
0022 //
0023 
0024 #include <boost/config.hpp>
0025 #include <boost/core/ref.hpp>
0026 
0027 #if BOOST_CXX_VERSION >= 201700L
0028 #include <functional>
0029 #endif
0030 
0031 namespace boost
0032 {
0033 
0034 namespace _bi
0035 {
0036 
0037 template<class R, class F> struct result_traits
0038 {
0039     typedef R type;
0040 };
0041 
0042 struct unspecified {};
0043 
0044 template<class F> struct result_traits<unspecified, F>
0045 {
0046     typedef typename F::result_type type;
0047 };
0048 
0049 template<class F> struct result_traits< unspecified, reference_wrapper<F> >
0050 {
0051     typedef typename F::result_type type;
0052 };
0053 
0054 #if BOOST_CXX_VERSION >= 201700L
0055 
0056 template<class T> struct result_traits< unspecified, std::plus<T> >
0057 {
0058     typedef T type;
0059 };
0060 
0061 template<class T> struct result_traits< unspecified, std::minus<T> >
0062 {
0063     typedef T type;
0064 };
0065 
0066 template<class T> struct result_traits< unspecified, std::multiplies<T> >
0067 {
0068     typedef T type;
0069 };
0070 
0071 template<class T> struct result_traits< unspecified, std::divides<T> >
0072 {
0073     typedef T type;
0074 };
0075 
0076 template<class T> struct result_traits< unspecified, std::modulus<T> >
0077 {
0078     typedef T type;
0079 };
0080 
0081 template<class T> struct result_traits< unspecified, std::negate<T> >
0082 {
0083     typedef T type;
0084 };
0085 
0086 template<class T> struct result_traits< unspecified, std::equal_to<T> >
0087 {
0088     typedef bool type;
0089 };
0090 
0091 template<class T> struct result_traits< unspecified, std::not_equal_to<T> >
0092 {
0093     typedef bool type;
0094 };
0095 
0096 template<class T> struct result_traits< unspecified, std::greater<T> >
0097 {
0098     typedef bool type;
0099 };
0100 
0101 template<class T> struct result_traits< unspecified, std::less<T> >
0102 {
0103     typedef bool type;
0104 };
0105 
0106 template<class T> struct result_traits< unspecified, std::greater_equal<T> >
0107 {
0108     typedef bool type;
0109 };
0110 
0111 template<class T> struct result_traits< unspecified, std::less_equal<T> >
0112 {
0113     typedef bool type;
0114 };
0115 
0116 template<class T> struct result_traits< unspecified, std::logical_and<T> >
0117 {
0118     typedef bool type;
0119 };
0120 
0121 template<class T> struct result_traits< unspecified, std::logical_or<T> >
0122 {
0123     typedef bool type;
0124 };
0125 
0126 template<class T> struct result_traits< unspecified, std::logical_not<T> >
0127 {
0128     typedef bool type;
0129 };
0130 
0131 template<class T> struct result_traits< unspecified, std::bit_and<T> >
0132 {
0133     typedef T type;
0134 };
0135 
0136 template<class T> struct result_traits< unspecified, std::bit_or<T> >
0137 {
0138     typedef T type;
0139 };
0140 
0141 template<class T> struct result_traits< unspecified, std::bit_xor<T> >
0142 {
0143     typedef T type;
0144 };
0145 
0146 #if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 40900
0147 
0148 // libstdc++ 4.8 and below don't have std::bit_not
0149 
0150 #else
0151 
0152 template<class T> struct result_traits< unspecified, std::bit_not<T> >
0153 {
0154     typedef T type;
0155 };
0156 
0157 #endif
0158 
0159 #endif
0160 
0161 } // namespace _bi
0162 
0163 } // namespace boost
0164 
0165 #endif // #ifndef BOOST_BIND_DETAIL_RESULT_TRAITS_HPP_INCLUDED