https://svn.boost.org/trac/boost/ticket/6131 https://svn.boost.org/trac/boost/changeset/75540 --- boost/foreach_fwd.hpp +++ boost/foreach_fwd.hpp @@ -14,6 +14,8 @@ #ifndef BOOST_FOREACH_FWD_HPP #define BOOST_FOREACH_FWD_HPP +#include // 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 + std::pair 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 + struct is_lightweight_proxy + : foreach::is_lightweight_proxy + {}; + + template + struct is_noncopyable + : foreach::is_noncopyable + {}; + +} // namespace BOOST_FOREACH + } // namespace boost #endif --- boost/foreach.hpp +++ boost/foreach.hpp @@ -165,7 +165,7 @@ // this one works on legacy compilers. Overload boost_foreach_is_lightweight_proxy // at the global namespace for your type. template -inline boost::foreach::is_lightweight_proxy * +inline boost::BOOST_FOREACH::is_lightweight_proxy * boost_foreach_is_lightweight_proxy(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; } template @@ -190,7 +190,7 @@ // this one works on legacy compilers. Overload boost_foreach_is_noncopyable // at the global namespace for your type. template -inline boost::foreach::is_noncopyable * +inline boost::BOOST_FOREACH::is_noncopyable * boost_foreach_is_noncopyable(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; } namespace boost