diff --git a/include/boost/geometry/index/detail/varray.hpp b/include/boost/geometry/index/detail/varray.hpp index a795b7c3f..63577e64a 100644 --- a/include/boost/geometry/index/detail/varray.hpp +++ b/include/boost/geometry/index/detail/varray.hpp @@ -1,6 +1,6 @@ // 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. // // Use, modification and distribution is subject to the Boost Software License, @@ -1406,7 +1406,7 @@ public: //! //! @par Complexity //! 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. //! @@ -1418,7 +1418,7 @@ public: //! //! @par Complexity //! 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. //! @@ -1442,7 +1442,7 @@ public: //! //! @par Complexity //! 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. //! @@ -1454,7 +1454,7 @@ public: //! //! @par Complexity //! 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. //! diff --git a/index/test/varray.cpp b/index/test/varray.cpp index 9040e97c0..d561f1c78 100644 --- a/index/test/varray.cpp +++ b/index/test/varray.cpp @@ -1,7 +1,7 @@ // Boost.Geometry.Index varray // Unit Test -// Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2012-2014 Adam Wulkiewicz, Lodz, Poland. // Copyright (c) 2012-2013 Andrew Hundt. // 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()); - test_compare_ranges(s.begin(), s.end(), v.rbegin(), v.rend()); - test_compare_ranges(s.rbegin(), s.rend(), v.begin(), v.end()); + test_compare_ranges(s.cbegin(), s.cend(), v.rbegin(), v.rend()); + test_compare_ranges(s.crbegin(), s.crend(), v.begin(), v.end()); + + varray const& cs = s; + std::vector 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