From f59aa7787131d3d0d87bfca98bfc54de66318517 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Thu, 9 Sep 2004 06:28:34 +0000 Subject: [PATCH] fixed and comment bounded array construct semantics [SVN r24982] --- include/boost/numeric/ublas/storage.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index 0fdcb6eb..e8947242 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -358,7 +358,7 @@ namespace boost { namespace numeric { namespace ublas { size_ (size) /*, data_ ()*/ { if (size_ > N) bad_size ().raise (); - std::fill (begin(), end(), value_type ()); + // data_ (an array) elements are already default constructed } // No value initialised, but still be default constructed BOOST_UBLAS_INLINE @@ -366,12 +366,14 @@ namespace boost { namespace numeric { namespace ublas { size_ (size) /*, data_ ()*/ { if (size_ > N) bad_size ().raise (); - std::fill (begin(), end(), init ) ; + // ISSUE elements should be value constructed here, but we must fill instead as already constructed + std::fill (begin(), end(), init) ; } BOOST_UBLAS_INLINE bounded_array (const bounded_array &c): size_ (c.size_) { - std::copy (c.data_, c.data_ + c.size_, data_); + // ISSUE elements should be copy constructed here, but we must copy instead as already constructed + std::copy (c.data_, c.data_ + c.size_, data_); } // Resizing