Bump version to 4.1-6
[LibreOffice.git] / boost / boost.4874.patch
blob7dbd33def32b1fda3a7ea19342eca67c08eeb372
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
5 @@ -18,6 +18,7 @@
6 // functionality is acquired
7 //
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"
13 @@ -82,5 +82,6 @@
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>
19 class array_iterator;
21 @@ -252,5 +253,17 @@
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();
35 + }
36 +};
37 +#endif
39 ////////////////////////////////////////////////////////////////////////
40 @@ -302,6 +315,14 @@
41 // iterator support
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;
49 +#else
50 + typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference,
51 + boost::random_access_traversal_tag> iterator;
52 +#endif
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;
57 @@ -322,5 +343,6 @@
58 const index* strides,
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);
65 @@ -333,7 +355,13 @@
67 index offset = 0;
68 - for (size_type n = 0; n != NumDims; ++n)
69 - offset += indices[n] * strides[n];
71 + {
72 + typename IndexList::const_iterator i = indices.begin();
73 + size_type n = 0;
74 + while (n != NumDims) {
75 + offset += (*i) * strides[n];
76 + ++n;
77 + ++i;
78 + }
79 + }
80 return base[offset];
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
86 @@ -132,4 +132,5 @@
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
96 @@ -45,14 +45,16 @@
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>
107 class array_iterator
108 : public
109 iterator_facade<
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
114 + , IteratorCategory
115 , Reference
117 @@ -70,5 +72,5 @@
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
124 @@ -80,5 +82,5 @@
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;
130 #else
131 @@ -106,7 +108,7 @@
132 strides_(strides), index_base_(index_base) { }
134 - template <typename OPtr, typename ORef>
135 + template <typename OPtr, typename ORef, typename Cat>
136 array_iterator(
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