Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75540 - trunk/boost
From: eric_at_[hidden]
Date: 2011-11-17 23:31:20


Author: eric_niebler
Date: 2011-11-17 23:31:19 EST (Thu, 17 Nov 2011)
New Revision: 75540
URL: http://svn.boost.org/trac/boost/changeset/75540

Log:
attempting to address #6131
Text files modified:
   trunk/boost/foreach.hpp | 4 ++--
   trunk/boost/foreach_fwd.hpp | 23 +++++++++++++++++++++++
   2 files changed, 25 insertions(+), 2 deletions(-)

Modified: trunk/boost/foreach.hpp
==============================================================================
--- trunk/boost/foreach.hpp (original)
+++ trunk/boost/foreach.hpp 2011-11-17 23:31:19 EST (Thu, 17 Nov 2011)
@@ -165,7 +165,7 @@
 // this one works on legacy compilers. Overload boost_foreach_is_lightweight_proxy
 // at the global namespace for your type.
 template<typename T>
-inline boost::foreach::is_lightweight_proxy<T> *
+inline boost::BOOST_FOREACH::is_lightweight_proxy<T> *
 boost_foreach_is_lightweight_proxy(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; }
 
 template<typename T>
@@ -190,7 +190,7 @@
 // this one works on legacy compilers. Overload boost_foreach_is_noncopyable
 // at the global namespace for your type.
 template<typename T>
-inline boost::foreach::is_noncopyable<T> *
+inline boost::BOOST_FOREACH::is_noncopyable<T> *
 boost_foreach_is_noncopyable(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; }
 
 namespace boost

Modified: trunk/boost/foreach_fwd.hpp
==============================================================================
--- trunk/boost/foreach_fwd.hpp (original)
+++ trunk/boost/foreach_fwd.hpp 2011-11-17 23:31:19 EST (Thu, 17 Nov 2011)
@@ -14,6 +14,8 @@
 #ifndef BOOST_FOREACH_FWD_HPP
 #define BOOST_FOREACH_FWD_HPP
 
+#include <utility> // for std::pair
+
 // This must be at global scope, hence the uglified name
 enum boost_foreach_argument_dependent_lookup_hack
 {
@@ -25,6 +27,9 @@
 
 namespace foreach
 {
+ template<typename T>
+ std::pair<T, T> in_range(T begin, T end);
+
     ///////////////////////////////////////////////////////////////////////////////
     // boost::foreach::tag
     //
@@ -46,6 +51,24 @@
 
 } // namespace foreach
 
+// Workaround for unfortunate https://svn.boost.org/trac/boost/ticket/6131
+namespace BOOST_FOREACH
+{
+ using foreach::in_range;
+ using foreach::tag;
+
+ template<typename T>
+ struct is_lightweight_proxy
+ : foreach::is_lightweight_proxy<T>
+ {};
+
+ template<typename T>
+ struct is_noncopyable
+ : foreach::is_noncopyable<T>
+ {};
+
+} // namespace BOOST_FOREACH
+
 } // namespace boost
 
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk