mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 05:24:02 +00:00
[index] fix varray const rbegin() and rend().
non-const reverse iterator type was used internally.
This commit is contained in:
parent
be637c0929
commit
3560ae1c93
@ -1,6 +1,6 @@
|
|||||||
// Boost.Container varray
|
// Boost.Container varray
|
||||||
//
|
//
|
||||||
// Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland.
|
// Copyright (c) 2012-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||||
// Copyright (c) 2011-2013 Andrew Hundt.
|
// Copyright (c) 2011-2013 Andrew Hundt.
|
||||||
//
|
//
|
||||||
// Use, modification and distribution is subject to the Boost Software License,
|
// Use, modification and distribution is subject to the Boost Software License,
|
||||||
@ -1406,7 +1406,7 @@ public:
|
|||||||
//!
|
//!
|
||||||
//! @par Complexity
|
//! @par Complexity
|
||||||
//! Constant O(1).
|
//! Constant O(1).
|
||||||
const_reverse_iterator rbegin() const { return reverse_iterator(this->end()); }
|
const_reverse_iterator rbegin() const { return const_reverse_iterator(this->end()); }
|
||||||
|
|
||||||
//! @brief Returns const reverse iterator to the first element of the reversed container.
|
//! @brief Returns const reverse iterator to the first element of the reversed container.
|
||||||
//!
|
//!
|
||||||
@ -1418,7 +1418,7 @@ public:
|
|||||||
//!
|
//!
|
||||||
//! @par Complexity
|
//! @par Complexity
|
||||||
//! Constant O(1).
|
//! Constant O(1).
|
||||||
const_reverse_iterator crbegin() const { return reverse_iterator(this->end()); }
|
const_reverse_iterator crbegin() const { return const_reverse_iterator(this->end()); }
|
||||||
|
|
||||||
//! @brief Returns reverse iterator to the one after the last element of the reversed container.
|
//! @brief Returns reverse iterator to the one after the last element of the reversed container.
|
||||||
//!
|
//!
|
||||||
@ -1442,7 +1442,7 @@ public:
|
|||||||
//!
|
//!
|
||||||
//! @par Complexity
|
//! @par Complexity
|
||||||
//! Constant O(1).
|
//! Constant O(1).
|
||||||
const_reverse_iterator rend() const { return reverse_iterator(this->begin()); }
|
const_reverse_iterator rend() const { return const_reverse_iterator(this->begin()); }
|
||||||
|
|
||||||
//! @brief Returns const reverse iterator to the one after the last element of the reversed container.
|
//! @brief Returns const reverse iterator to the one after the last element of the reversed container.
|
||||||
//!
|
//!
|
||||||
@ -1454,7 +1454,7 @@ public:
|
|||||||
//!
|
//!
|
||||||
//! @par Complexity
|
//! @par Complexity
|
||||||
//! Constant O(1).
|
//! Constant O(1).
|
||||||
const_reverse_iterator crend() const { return reverse_iterator(this->begin()); }
|
const_reverse_iterator crend() const { return const_reverse_iterator(this->begin()); }
|
||||||
|
|
||||||
//! @brief Returns container's capacity.
|
//! @brief Returns container's capacity.
|
||||||
//!
|
//!
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Boost.Geometry.Index varray
|
// Boost.Geometry.Index varray
|
||||||
// Unit Test
|
// Unit Test
|
||||||
|
|
||||||
// Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland.
|
// Copyright (c) 2012-2014 Adam Wulkiewicz, Lodz, Poland.
|
||||||
// Copyright (c) 2012-2013 Andrew Hundt.
|
// Copyright (c) 2012-2013 Andrew Hundt.
|
||||||
|
|
||||||
// Use, modification and distribution is subject to the Boost Software License,
|
// Use, modification and distribution is subject to the Boost Software License,
|
||||||
@ -283,8 +283,15 @@ void test_iterators_nd()
|
|||||||
|
|
||||||
s.assign(v.rbegin(), v.rend());
|
s.assign(v.rbegin(), v.rend());
|
||||||
|
|
||||||
test_compare_ranges(s.begin(), s.end(), v.rbegin(), v.rend());
|
test_compare_ranges(s.cbegin(), s.cend(), v.rbegin(), v.rend());
|
||||||
test_compare_ranges(s.rbegin(), s.rend(), v.begin(), v.end());
|
test_compare_ranges(s.crbegin(), s.crend(), v.begin(), v.end());
|
||||||
|
|
||||||
|
varray<T, N> const& cs = s;
|
||||||
|
std::vector<T> const& cv = v;
|
||||||
|
s.assign(cv.rbegin(), cv.rend());
|
||||||
|
|
||||||
|
test_compare_ranges(cs.begin(), cs.end(), cv.rbegin(), cv.rend());
|
||||||
|
test_compare_ranges(cs.rbegin(), cs.rend(), cv.begin(), cv.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, size_t N>
|
template <typename T, size_t N>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user