2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-22 15:52:18 +00:00

storage.hpp: fix #2891, now check new size instead of old one

This commit is contained in:
Gunter Winkler
2009-04-02 21:46:07 +00:00
parent 3792d3353b
commit 4e91a78aac

View File

@@ -340,12 +340,12 @@ namespace boost { namespace numeric { namespace ublas {
// Resizing
BOOST_UBLAS_INLINE
void resize (size_type size) {
BOOST_UBLAS_CHECK (size_ <= N, bad_size ());
BOOST_UBLAS_CHECK (size <= N, bad_size ());
size_ = size;
}
BOOST_UBLAS_INLINE
void resize (size_type size, value_type init) {
BOOST_UBLAS_CHECK (size_ <= N, bad_size ());
BOOST_UBLAS_CHECK (size <= N, bad_size ());
if (size > size_)
std::fill (data_ + size_, data_ + size, init);
size_ = size;