Boost logo

Ublas :

From: Vyacheslav E. Andrejev (vandrejev_at_[hidden])
Date: 2005-08-20 22:43:28


There is a bug in unbounded_array::resize_internal. Pointer to new allocated
memory is assigned to unbounded_array::data_ member only if previous size
wasn't zero:

                if (size_) {
                    const iterator i_end = end();
                    for (iterator i = begin(); i != i_end; ++i) {
                        iterator_destroy (i);
                    alloc_.deallocate (data_, size_);
                    data_ = data;

Therefore if I'm going to resize vector with zero size (created by default
constructor for example), data_ remains zero pointer.

Vyacheslav E. Andrejev
System Architect, Excelsior, LLC