From 8c6d65167605347a55b784239e45d594d68ea475 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sun, 16 Dec 2012 01:02:38 +0000 Subject: [PATCH] Fixed wrong assert in static_vector::insert(pos, val) Test added. [SVN r82003] --- .../boost/geometry/extensions/index/static_vector.hpp | 2 +- test/static_vector.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/extensions/index/static_vector.hpp b/include/boost/geometry/extensions/index/static_vector.hpp index 5f36514a2..9a9acf3dc 100644 --- a/include/boost/geometry/extensions/index/static_vector.hpp +++ b/include/boost/geometry/extensions/index/static_vector.hpp @@ -167,7 +167,7 @@ public: { // TODO change name of this macro BOOST_GEOMETRY_INDEX_ASSERT_UNUSED_PARAM(difference_type dist = std::distance(this->begin(), position)); - BOOST_ASSERT_MSG(0 <= dist && (sizeof(dist)<=sizeof(m_size)?((size_type)dist s1(s); + for ( size_t i = 0 ; i < h ; ++i ) + s1.insert(s1.end(), v); + BOOST_CHECK(s1.size() == 2*h); + for ( size_t i = 0 ; i < h ; ++i ) + BOOST_CHECK(s1[i] == T(i)); + for ( size_t i = 0 ; i < h ; ++i ) + BOOST_CHECK(s1[i+h] == v); + } } int test_main(int, char* [])