Glas :Re: [glas] unallocated fill |
From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2005-10-03 02:19:12
On Friday 30 September 2005 20:22, Neal Becker wrote:
> Suggest adding to dense_vector.hpp:
> dense_vector(size_type size, value_type const& init)
>
> : size_( size )
>
> {
> begin_ = alloc_.allocate( size ) ;
> std::uninitialized_fill (begin(), end(), init);
>
> }
> _______________________________________________
> glas mailing list
> glas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/glas
Hi Neal,
Personally, I prefer a free function fill( v, init ) ;
Similarly, clear_values() and clear() also are free functions.
rather than a member function. I agree that some form of initialization is
quite useful.
Karl