Ticket #5279: foreach.2.patch
File foreach.2.patch, 2.0 KB (added by , 12 years ago) |
---|
-
boost-trunk/boost/foreach.hpp
31 31 32 32 // Some compilers let us detect even const-qualified rvalues at compile-time 33 33 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_) \ 34 || (BOOST_WORKAROUND(__GNUC__, >= 4) && !defined(BOOST_INTEL) && !defined(BOOST_CLANG)) \ 34 || (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) && !defined(BOOST_INTEL) && \ 35 !defined(BOOST_CLANG)) \ 35 36 || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) && \ 36 !defined(BOOST_CLANG)) 37 !defined(BOOST_CLANG)) \ 38 || !defined(BOOST_NO_RVALUE_REFERENCES) 37 39 # define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION 38 40 #else 39 41 // Some compilers allow temporaries to be bound to non-const references. … … 80 82 #include <boost/type_traits/is_const.hpp> 81 83 #include <boost/type_traits/is_abstract.hpp> 82 84 #include <boost/type_traits/is_base_and_derived.hpp> 85 #include <boost/type_traits/is_rvalue_reference.hpp> 83 86 #include <boost/iterator/iterator_traits.hpp> 84 87 #include <boost/utility/addressof.hpp> 85 88 #include <boost/foreach_fwd.hpp> … … 213 216 template<typename Bool1> 214 217 inline boost::mpl::not_<Bool1> *not_(Bool1 *) { return 0; } 215 218 219 #ifdef BOOST_NO_RVALUE_REFERENCES 216 220 template<typename T> 217 221 inline boost::mpl::false_ *is_rvalue_(T &, int) { return 0; } 218 222 219 223 template<typename T> 220 224 inline boost::mpl::true_ *is_rvalue_(T const &, ...) { return 0; } 225 #else 226 template<typename T> 227 inline boost::is_rvalue_reference<T&&> *is_rvalue_(T&& t, int) { return 0; } 228 #endif 221 229 222 230 template<typename T> 223 231 inline boost::is_array<T> *is_array_(T const &) { return 0; }