3333
3434#include < boost/detail/workaround.hpp>
3535
36- #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
37- # pragma warning(push)
36+ #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
37+ # pragma warning(push)
3838# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
39- # pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
40- # pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
39+ # pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
40+ # pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
4141#endif
4242
4343#include < cstddef>
4444#include < iterator>
4545#include < stdexcept>
4646#include < boost/assert.hpp>
47- #include < boost/core/swap .hpp>
47+ #include < boost/core/invoke_swap .hpp>
4848#include < boost/static_assert.hpp>
4949
5050#include < boost/throw_exception.hpp>
@@ -75,7 +75,7 @@ namespace boost {
7575 iterator begin () { return elems; }
7676 const_iterator begin () const { return elems; }
7777 const_iterator cbegin () const { return elems; }
78-
78+
7979 iterator end () { return elems+N; }
8080 const_iterator end () const { return elems+N; }
8181 const_iterator cend () const { return elems+N; }
@@ -84,9 +84,9 @@ namespace boost {
8484#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
8585 typedef std::reverse_iterator<iterator> reverse_iterator;
8686 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
87- #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
88- typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
89- value_type, reference, iterator, difference_type> reverse_iterator;
87+ #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
88+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
89+ value_type, reference, iterator, difference_type> reverse_iterator;
9090 typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
9191 value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
9292#else
@@ -112,39 +112,39 @@ namespace boost {
112112 }
113113
114114 // operator[]
115- reference operator [](size_type i)
116- {
117- return BOOST_ASSERT_MSG ( i < N, " out of range" ), elems[i];
115+ reference operator [](size_type i)
116+ {
117+ return BOOST_ASSERT_MSG ( i < N, " out of range" ), elems[i];
118118 }
119-
120- /* BOOST_CONSTEXPR*/ const_reference operator [](size_type i) const
121- {
122- return BOOST_ASSERT_MSG ( i < N, " out of range" ), elems[i];
119+
120+ /* BOOST_CONSTEXPR*/ const_reference operator [](size_type i) const
121+ {
122+ return BOOST_ASSERT_MSG ( i < N, " out of range" ), elems[i];
123123 }
124124
125125 // at() with range check
126126 reference at (size_type i) { return rangecheck (i), elems[i]; }
127127 /* BOOST_CONSTEXPR*/ const_reference at (size_type i) const { return rangecheck (i), elems[i]; }
128-
128+
129129 // front() and back()
130- reference front ()
131- {
132- return elems[0 ];
130+ reference front ()
131+ {
132+ return elems[0 ];
133133 }
134-
135- BOOST_CONSTEXPR const_reference front () const
134+
135+ BOOST_CONSTEXPR const_reference front () const
136136 {
137137 return elems[0 ];
138138 }
139-
140- reference back ()
141- {
142- return elems[N-1 ];
139+
140+ reference back ()
141+ {
142+ return elems[N-1 ];
143143 }
144-
145- BOOST_CONSTEXPR const_reference back () const
146- {
147- return elems[N-1 ];
144+
145+ BOOST_CONSTEXPR const_reference back () const
146+ {
147+ return elems[N-1 ];
148148 }
149149
150150 // size is constant
@@ -156,7 +156,7 @@ namespace boost {
156156 // swap (note: linear complexity)
157157 void swap (array<T,N>& y) {
158158 for (size_type i = 0 ; i < N; ++i)
159- boost::swap (elems[i],y.elems [i]);
159+ boost::core::invoke_swap (elems[i],y.elems [i]);
160160 }
161161
162162 // direct access to data (read-only)
@@ -213,9 +213,9 @@ namespace boost {
213213#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
214214 typedef std::reverse_iterator<iterator> reverse_iterator;
215215 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
216- #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
217- typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
218- value_type, reference, iterator, difference_type> reverse_iterator;
216+ #elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
217+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
218+ value_type, reference, iterator, difference_type> reverse_iterator;
219219 typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
220220 value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
221221#else
@@ -301,7 +301,7 @@ namespace boost {
301301 // assign one value to all elements
302302 void assign (const T& value) { fill ( value ); }
303303 void fill (const T& ) {}
304-
304+
305305 // check range (may be private because it is static)
306306 static reference failed_rangecheck () {
307307 std::out_of_range e (" attempt to access element of an empty array" );
@@ -353,16 +353,16 @@ namespace boost {
353353#if defined(__SUNPRO_CC)
354354// Trac ticket #4757; the Sun Solaris compiler can't handle
355355// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
356- //
357- // We can't just use this for all compilers, because the
358- // borland compilers can't handle this form.
356+ //
357+ // We can't just use this for all compilers, because the
358+ // borland compilers can't handle this form.
359359 namespace detail {
360360 template <typename T, std::size_t N> struct c_array
361361 {
362362 typedef T type[N];
363363 };
364364 }
365-
365+
366366 // Specific for boost::array: simply returns its elems data member.
367367 template <typename T, std::size_t N>
368368 typename detail::c_array<T,N>::type& get_c_array (boost::array<T,N>& arg)
@@ -383,15 +383,15 @@ namespace boost {
383383 {
384384 return arg.elems ;
385385 }
386-
386+
387387 // Const version.
388388 template <typename T, std::size_t N>
389389 const T (&get_c_array (const boost::array<T,N>& arg))[N]
390390 {
391391 return arg.elems ;
392392 }
393393#endif
394-
394+
395395#if 0
396396 // Overload for std::array, assuming that std::array will have
397397 // explicit conversion functions as discussed at the WG21 meeting
@@ -401,7 +401,7 @@ namespace boost {
401401 {
402402 return static_cast<T(&)[N]>(arg);
403403 }
404-
404+
405405 // Const version.
406406 template <typename T, std::size_t N>
407407 const T(&get_c_array(const std::array<T,N>& arg))[N]
@@ -423,7 +423,7 @@ namespace boost {
423423 BOOST_STATIC_ASSERT_MSG ( Idx < N, " boost::get<>(boost::array &) index out of range" );
424424 return arr[Idx];
425425 }
426-
426+
427427 template <size_t Idx, typename T, size_t N>
428428 const T &get (const boost::array<T,N> &arr) BOOST_NOEXCEPT {
429429 BOOST_STATIC_ASSERT_MSG ( Idx < N, " boost::get<>(const boost::array &) index out of range" );
@@ -440,7 +440,7 @@ namespace std {
440440 BOOST_STATIC_ASSERT_MSG ( Idx < N, " std::get<>(boost::array &) index out of range" );
441441 return arr[Idx];
442442 }
443-
443+
444444 template <size_t Idx, typename T, size_t N>
445445 const T &get (const boost::array<T,N> &arr) BOOST_NOEXCEPT {
446446 BOOST_STATIC_ASSERT_MSG ( Idx < N, " std::get<>(const boost::array &) index out of range" );
@@ -449,8 +449,8 @@ namespace std {
449449}
450450#endif
451451
452- #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
453- # pragma warning(pop)
454- #endif
452+ #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
453+ # pragma warning(pop)
454+ #endif
455455
456456#endif /* BOOST_ARRAY_HPP*/
0 commit comments