2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-21 03:22:14 +00:00

bounded_array default construct size 0

Use bounded_vector/matrix do get a presized default

svn path=/trunk/boost/boost/numeric/ublas/; revision=24933
This commit is contained in:
Michael Stevens
2004-09-06 09:02:23 +00:00
parent 4914cdaa70
commit 8a625ffe2c

View File

@@ -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_ ()*/ {