src/cxx_supportlib/vendor-modified/boost/foreach.hpp in passenger-6.0.7 vs src/cxx_supportlib/vendor-modified/boost/foreach.hpp in passenger-6.0.8
- old
+ new
@@ -28,10 +28,17 @@
#include <utility> // for std::pair
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
+// Define a compiler generic null pointer value
+#if defined(BOOST_NO_NULLPTR)
+#define BOOST_FOREACH_NULL 0
+#else
+#define BOOST_FOREACH_NULL nullptr
+#endif
+
// Some compilers let us detect even const-qualified rvalues at compile-time
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|| defined(BOOST_MSVC) && !defined(_PREFAST_) \
|| (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) && !defined(BOOST_INTEL) && \
!defined(BOOST_CLANG)) \
@@ -907,11 +914,11 @@
# define BOOST_FOREACH_ID(x) BOOST_PP_CAT(x, __LINE__)
#endif
// A sneaky way to get the type of the collection without evaluating the expression
#define BOOST_FOREACH_TYPEOF(COL) \
- (true ? 0 : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL)))
+ (true ? BOOST_FOREACH_NULL : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL)))
// returns true_* if the type is noncopyable
#define BOOST_FOREACH_IS_NONCOPYABLE(COL) \
boost_foreach_is_noncopyable( \
boost::foreach_detail_::to_ptr(COL) \
@@ -937,11 +944,11 @@
// Evaluate the collection expression
# define BOOST_FOREACH_EVALUATE(COL) \
(COL)
# define BOOST_FOREACH_SHOULD_COPY(COL) \
- (true ? 0 : boost::foreach_detail_::or_( \
+ (true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \
BOOST_FOREACH_IS_RVALUE(COL) \
, BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL)))
#elif defined(BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION)
///////////////////////////////////////////////////////////////////////////////
@@ -960,15 +967,15 @@
// The rvalue/lvalue-ness of the collection expression is determined dynamically, unless
// the type is an array or is noncopyable or is non-const, in which case we know it's an lvalue.
// If the type happens to be a lightweight proxy, always make a copy.
# define BOOST_FOREACH_SHOULD_COPY(COL) \
(boost::foreach_detail_::should_copy_impl( \
- true ? 0 : boost::foreach_detail_::or_( \
+ true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \
boost::foreach_detail_::is_array_(COL) \
, BOOST_FOREACH_IS_NONCOPYABLE(COL) \
, boost::foreach_detail_::not_(boost::foreach_detail_::is_const_(COL))) \
- , true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \
+ , true ? BOOST_FOREACH_NULL : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \
, &BOOST_FOREACH_ID(_foreach_is_rvalue)))
#elif !defined(BOOST_FOREACH_NO_RVALUE_DETECTION)
///////////////////////////////////////////////////////////////////////////////
// R-values supported here, const R-values NOT supported here
@@ -983,11 +990,11 @@
(COL)
// Determine whether the collection expression is an lvalue or an rvalue.
// NOTE: this gets the answer wrong for const rvalues.
# define BOOST_FOREACH_SHOULD_COPY(COL) \
- (true ? 0 : boost::foreach_detail_::or_( \
+ (true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \
boost::foreach_detail_::is_rvalue_((COL), 0) \
, BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL)))
#else
///////////////////////////////////////////////////////////////////////////////
@@ -1002,10 +1009,10 @@
# define BOOST_FOREACH_EVALUATE(COL) \
(COL)
// Can't use rvalues with BOOST_FOREACH (unless they are lightweight proxies)
# define BOOST_FOREACH_SHOULD_COPY(COL) \
- (true ? 0 : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))
+ (true ? BOOST_FOREACH_NULL : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))
#endif
#define BOOST_FOREACH_CONTAIN(COL) \
boost::foreach_detail_::contain( \