1 Index: branches/release/boost/multi_array/base.hpp
2 ===================================================================
3 --- a/branches/release/boost/multi_array/base.hpp
4 +++ b/branches/release/boost/multi_array/base.hpp
6 // functionality is acquired
9 +#include "boost/multi_array/collection_concept.hpp"
10 #include "boost/multi_array/extent_range.hpp"
11 #include "boost/multi_array/extent_gen.hpp"
12 #include "boost/multi_array/index_range.hpp"
14 class const_sub_array;
16 -template <typename T, typename TPtr, typename NumDims, typename Reference>
17 + template <typename T, typename TPtr, typename NumDims, typename Reference,
18 + typename IteratorCategory>
22 /////////////////////////////////////////////////////////////////////////
25 +// Due to some imprecision in the C++ Standard,
26 +// MSVC 2010 is broken in debug mode: it requires
27 +// that an Output Iterator have output_iterator_tag in its iterator_category if
28 +// that iterator is not bidirectional_iterator or random_access_iterator.
29 +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
30 +struct mutable_iterator_tag
31 + : boost::random_access_traversal_tag, std::input_iterator_tag
33 + operator std::output_iterator_tag() const {
34 + return std::output_iterator_tag();
39 ////////////////////////////////////////////////////////////////////////
43 - typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference> iterator;
44 - typedef array_iterator<T,T const*,mpl::size_t<NumDims>,const_reference> const_iterator;
45 +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1600)
46 + // Deal with VC 2010 output_iterator_tag requirement
47 + typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
48 + mutable_iterator_tag> iterator;
50 + typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
51 + boost::random_access_traversal_tag> iterator;
53 + typedef array_iterator<T,T const*,mpl::size_t<NumDims>,const_reference,
54 + boost::random_access_traversal_tag> const_iterator;
56 typedef ::boost::reverse_iterator<iterator> reverse_iterator;
59 const index* index_bases) const {
61 + boost::function_requires<
62 + detail::multi_array::CollectionConcept<IndexList> >();
63 ignore_unused_variable_warning(index_bases);
64 ignore_unused_variable_warning(extents);
68 - for (size_type n = 0; n != NumDims; ++n)
69 - offset += indices[n] * strides[n];
72 + typename IndexList::const_iterator i = indices.begin();
74 + while (n != NumDims) {
75 + offset += (*i) * strides[n];
82 Index: branches/release/boost/multi_array/concept_checks.hpp
83 ===================================================================
84 --- a/branches/release/boost/multi_array/concept_checks.hpp
85 +++ b/branches/release/boost/multi_array/concept_checks.hpp
87 function_requires< boost_concepts::ForwardTraversalConcept<const_iterator> >();
88 function_requires< boost_concepts::ReadableIteratorConcept<const_iterator> >();
89 + function_requires< boost::OutputIterator<iterator,value_type> >();
91 // RG - a( CollectionArchetype) when available...
92 Index: branches/release/boost/multi_array/iterator.hpp
93 ===================================================================
94 --- a/branches/release/boost/multi_array/iterator.hpp
95 +++ b/branches/release/boost/multi_array/iterator.hpp
99 -template <typename T, typename TPtr, typename NumDims, typename Reference>
100 +template <typename T, typename TPtr, typename NumDims, typename Reference,
101 + typename IteratorCategory>
102 class array_iterator;
104 -template <typename T, typename TPtr, typename NumDims, typename Reference>
105 +template <typename T, typename TPtr, typename NumDims, typename Reference,
106 + typename IteratorCategory>
110 - array_iterator<T,TPtr,NumDims,Reference>
111 + array_iterator<T,TPtr,NumDims,Reference,IteratorCategory>
112 , typename associated_types<T,NumDims>::value_type
113 - , boost::random_access_traversal_tag
119 typedef iterator_facade<
120 - array_iterator<T,TPtr,NumDims,Reference>
121 + array_iterator<T,TPtr,NumDims,Reference,IteratorCategory>
122 , typename detail::multi_array::associated_types<T,NumDims>::value_type
123 , boost::random_access_traversal_tag
126 #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
127 - template <typename, typename, typename, typename>
128 + template <typename, typename, typename, typename, typename>
129 friend class array_iterator;
132 strides_(strides), index_base_(index_base) { }
134 - template <typename OPtr, typename ORef>
135 + template <typename OPtr, typename ORef, typename Cat>
137 - const array_iterator<T,OPtr,NumDims,ORef>& rhs
138 + const array_iterator<T,OPtr,NumDims,ORef,Cat>& rhs
139 , typename boost::enable_if_convertible<OPtr,TPtr>::type* = 0