Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2005-08-21 03:53:08


Am Sonntag, 21. August 2005 05:43 schrieb Vyacheslav E. Andrejev:
> Hello,
>
> 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.

I already provided a patch: See my posting
'Re: [ublas] warning in unbounded_array::resize_internal(...), new
patch'

mfg
Gunter