Ticket #2676: djw_result_of_codegear.patch
File djw_result_of_codegear.patch, 6.5 KB (added by , 14 years ago) |
---|
-
boost/utility/detail/result_of_iterate.hpp
1 1 // Boost result_of library 2 2 3 // Copyright Douglas Gregor 2004. Use, modification and3 // Copyright Douglas Gregor and Daniel Walker 2004-2009. Use, modification and 4 4 // distribution is subject to the Boost Software License, Version 5 5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 6 // http://www.boost.org/LICENSE_1_0.txt) … … 10 10 # error Boost result_of - do not include this file! 11 11 #endif 12 12 13 #if defined(BOOST_HAS_DECLTYPE) 13 #if (!defined(BOOST_HAS_DECLTYPE) \ 14 || BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))) 15 # define BOOST_NO_ISO_RESULT_OF 1 16 #endif 14 17 18 #if !defined(BOOST_NO_ISO_RESULT_OF) 19 15 20 // As of N2588, C++0x result_of only supports function call 16 21 // expressions of the form f(x). This precludes support for member 17 22 // function pointers, which are invoked with expressions of the form … … 49 54 50 55 } // namespace detail 51 56 52 #else // defined(BOOST_HAS_DECLTYPE)57 #else // !defined(BOOST_NO_ISO_RESULT_OF) 53 58 54 59 // CWPro8 requires an argument in a function type specialization 55 60 #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3002)) && BOOST_PP_ITERATION() == 0 -
boost/utility/result_of.hpp
92 92 93 93 #else 94 94 # define BOOST_NO_RESULT_OF 1 95 # define BOOST_NO_ISO_RESULT_OF 1 95 96 #endif 96 97 97 98 } -
libs/utility/utility.htm
154 154 ...,t<em>N</em>)</code>. The implementation permits 155 155 the type <code>F</code> to be a function pointer, 156 156 function reference, member function pointer, or class 157 type.</p> <p>If your compiler does not support 158 <code>decltype</code>, then when <code>F</code> is a 157 type.</p> <p>If your compiler cannot support the ISO 158 draft specification of <code>result_of</code>, 159 <a href="http://www.open-std.org/JTC1/sc22/wg21/docs/papers/2008/n2798.pdf">N2798</a> 20.7.4, 160 then the macro <code>BOOST_NO_ISO_RESULT_OF</code> is 161 defined, and the following protocol is followed to 162 determine the type of call expressions. 163 When <code>F</code> is a 159 164 class type with a member type <code>result_type</code>, 160 165 <code>result_of<F(T1, T2, ..., 161 166 T<em>N</em>)></code> is -
libs/utility/test/result_of_test.cpp
1 1 // Boost result_of library 2 2 3 // Copyright Douglas Gregor 2003-2004. Use, modification and3 // Copyright Douglas Gregor and Daniel Walker 2003-2009. Use, modification and 4 4 // distribution is subject to the Boost Software License, Version 5 5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 6 // http://www.boost.org/LICENSE_1_0.txt) … … 133 133 134 134 // Prior to decltype, result_of could not deduce the return type 135 135 // nullary function objects unless they exposed a result_type. 136 #if defined(BOOST_HAS_DECLTYPE) 136 #if defined(BOOST_NO_ISO_RESULT_OF) 137 BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(void)>::type, void>::value)); 138 BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, void>::value)); 139 BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(void)>::type, void>::value)); 140 BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of_template<void>(void)>::type, void>::value)); 141 #else 137 142 BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(void)>::type, int>::value)); 138 143 BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, int>::value)); 139 144 BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(void)>::type, int>::value)); 140 145 BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of_template<void>(void)>::type, int>::value)); 141 #else142 BOOST_STATIC_ASSERT((is_same<result_of<int_result_of(void)>::type, void>::value));143 BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of(void)>::type, void>::value));144 BOOST_STATIC_ASSERT((is_same<result_of<int_result_of_template<void>(void)>::type, void>::value));145 BOOST_STATIC_ASSERT((is_same<result_of<volatile int_result_of_template<void>(void)>::type, void>::value));146 146 #endif 147 147 148 148 // Prior to decltype, result_of ignored a nested result<> if 149 149 // result_type was defined. After decltype, result_of deduces the 150 150 // actual return type of the function object, ignoring both 151 151 // result<> and result_type. 152 #if defined(BOOST_HAS_DECLTYPE) 152 #if defined(BOOST_NO_ISO_RESULT_OF) 153 BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return(char)>::type, int>::value)); 154 BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return_template<void>(char)>::type, int>::value)); 155 #else 153 156 BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return(char)>::type, char>::value)); 154 157 BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return_template<void>(char)>::type, char>::value)); 155 #else156 BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return(char)>::type, int>::value));157 BOOST_STATIC_ASSERT((is_same<result_of<int_result_type_and_float_result_of_and_char_return_template<void>(char)>::type, int>::value));158 158 #endif 159 159 160 160 BOOST_STATIC_ASSERT((is_same<result_of<func_ptr(char, float)>::type, int>::value)); … … 181 181 BOOST_STATIC_ASSERT((is_same<result_of<pf_t(int)>::type, int>::value)); 182 182 BOOST_STATIC_ASSERT((is_same<result_of<pf_t const(int)>::type,int>::value)); 183 183 184 #if defined(BOOST_HAS_DECLTYPE)184 #if !defined(BOOST_NO_ISO_RESULT_OF) 185 185 BOOST_STATIC_ASSERT((is_same<result_of<no_result_type_or_result_of(double)>::type, int>::value)); 186 186 BOOST_STATIC_ASSERT((is_same<result_of<no_result_type_or_result_of(void)>::type, unsigned int>::value)); 187 187 BOOST_STATIC_ASSERT((is_same<result_of<const no_result_type_or_result_of(double)>::type, short>::value));