From 8a625ffe2c1eaee32d4c880ae8428dc85c7c0604 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Mon, 6 Sep 2004 09:02:23 +0000 Subject: [PATCH] bounded_array default construct size 0 Use bounded_vector/matrix do get a presized default svn path=/trunk/boost/boost/numeric/ublas/; revision=24933 --- include/boost/numeric/ublas/storage.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index edace945..c177c528 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -352,19 +352,16 @@ namespace boost { namespace numeric { namespace ublas { // Construction and destruction BOOST_UBLAS_INLINE bounded_array (): - // Kresimir Fresl suggested to change the default back to the template argument. - size_ (N), data_ () { - const value_type v = value_type (0); - std::fill (begin(), end(), v); + size_ (0), data_ () { // size 0 - use bounded_vector to default construct with size N } explicit BOOST_UBLAS_INLINE bounded_array (size_type size): size_ (size) /*, data_ ()*/ { if (size_ > N) bad_size ().raise (); - const value_type v = value_type (0); - std::fill (begin(), end(), v); + std::fill (begin(), end(), value_type (0)); } + // No value initialised, but still be default constructed BOOST_UBLAS_INLINE bounded_array (size_type size, no_init): size_ (size) /*, data_ ()*/ {