|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82025 - sandbox-branches/geometry/index/boost/geometry/extensions/index
From: adam.wulkiewicz_at_[hidden]
Date: 2012-12-16 11:13:36
Author: awulkiew
Date: 2012-12-16 11:13:35 EST (Sun, 16 Dec 2012)
New Revision: 82025
URL: http://svn.boost.org/trac/boost/changeset/82025
Log:
static_vector: assertion moved.
Text files modified:
sandbox-branches/geometry/index/boost/geometry/extensions/index/static_vector.hpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/static_vector.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/static_vector.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/static_vector.hpp 2012-12-16 11:13:35 EST (Sun, 16 Dec 2012)
@@ -114,6 +114,7 @@
{
BOOST_ASSERT_MSG(count <= Capacity, "size can't exceed the capacity");
//if ( Capacity <= count ) throw std::bad_alloc();
+
this->construct(this->end(), this->begin() + count); // may throw
}
m_size = count; // update end
@@ -130,6 +131,7 @@
{
BOOST_ASSERT_MSG(count <= Capacity, "size can't exceed the capacity");
//if ( Capacity <= count ) throw std::bad_alloc();
+
std::uninitialized_fill(this->end(), this->begin() + count, value); // may throw
}
m_size = count; // update end
@@ -147,6 +149,7 @@
{
BOOST_ASSERT_MSG(m_size < Capacity, "size can't exceed the capacity");
//if ( Capacity <= m_size ) throw std::bad_alloc();
+
this->uninitialized_fill(this->end(), value); // may throw
++m_size; // update end
}
@@ -282,9 +285,10 @@
}
else
{
- std::fill_n(this->begin(), m_size, value);
BOOST_ASSERT_MSG(count <= Capacity, "size can't exceed the capacity");
//if ( Capacity <= count ) throw std::bad_alloc();
+
+ std::fill_n(this->begin(), m_size, value);
std::uninitialized_fill(this->end(), this->begin() + count, value); // may throw
}
m_size = count; // update end
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk