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

fix unbounded_array copy cstrct with size_

explicit 0 value for range, stride values 0

svn path=/trunk/boost/boost/numeric/ublas/; revision=24902
This commit is contained in:
Michael Stevens
2004-09-04 14:47:39 +00:00
parent 0b551660ab
commit 8db59c200f

View File

@@ -106,12 +106,16 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_INLINE
unbounded_array (const unbounded_array &c):
alloc (c.alloc), size_ (c.size_) {
data_ = alloc.allocate (c.size_);
const_iterator ci = c.begin();
for (iterator i = begin(); i != end(); ++i) {
alloc.construct (&(*i), *ci);
++ci;
if (size_) {
data_ = alloc.allocate (c.size_);
const_iterator ci = c.begin();
for (iterator i = begin(); i != end(); ++i) {
alloc.construct (&(*i), *ci);
++ci;
}
}
else
data_ = 0;
}
BOOST_UBLAS_INLINE
~unbounded_array () {
@@ -965,7 +969,7 @@ namespace boost { namespace numeric { namespace ublas {
// Construction and destruction
BOOST_UBLAS_INLINE
range ():
start_ (), size_ () {}
start_ (0), size_ (0) {}
BOOST_UBLAS_INLINE
range (size_type start, size_type stop):
start_ (start), size_ (stop - start) {
@@ -1163,7 +1167,7 @@ namespace boost { namespace numeric { namespace ublas {
// Construction and destruction
BOOST_UBLAS_INLINE
slice ():
start_ (), stride_ (), size_ () {}
start_ (0), stride_ (0), size_ (0) {}
BOOST_UBLAS_INLINE
slice (size_type start, difference_type stride, size_type size):
start_ (start), stride_ (stride), size_ (size) {}