Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r78495 - trunk/boost/multi_array
From: garcia_at_[hidden]
Date: 2012-05-17 09:53:04


Author: garcia
Date: 2012-05-17 09:53:04 EDT (Thu, 17 May 2012)
New Revision: 78495
URL: http://svn.boost.org/trac/boost/changeset/78495

Log:
Only include output_iterator_tag for Visual Studio 2010 and forward.
This is needed for its debug mode to compile due to some troublesome
Standard text.

Text files modified:
   trunk/boost/multi_array/base.hpp | 14 ++++++++++++--
   1 files changed, 12 insertions(+), 2 deletions(-)

Modified: trunk/boost/multi_array/base.hpp
==============================================================================
--- trunk/boost/multi_array/base.hpp (original)
+++ trunk/boost/multi_array/base.hpp 2012-05-17 09:53:04 EDT (Thu, 17 May 2012)
@@ -252,7 +252,11 @@
 // choose value accessor ends
 /////////////////////////////////////////////////////////////////////////
 
-
+// Due to some imprecision in the C++ Standard,
+// MSVC 2010 is broken in debug mode: it requires
+// that an Output Iterator have output_iterator_tag in its iterator_category if
+// that iterator is not bidirectional_iterator or random_access_iterator.
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
 struct mutable_iterator_tag
  : boost::random_access_traversal_tag, std::input_iterator_tag
 {
@@ -260,7 +264,7 @@
     return std::output_iterator_tag();
   }
 };
-
+#endif
 
 ////////////////////////////////////////////////////////////////////////
 // multi_array_base
@@ -310,8 +314,14 @@
   //
   // iterator support
   //
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
+ // Deal with VC 2010 output_iterator_tag requirement
   typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
                          mutable_iterator_tag> iterator;
+#else
+ typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
+ boost::random_access_traversal_tag> iterator;
+#endif
   typedef array_iterator<T,T const*,mpl::size_t<NumDims>,const_reference,
                          boost::random_access_traversal_tag> const_iterator;
 


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