From: rwgk (rwgk_at_[hidden])
Date: 2002-03-08 15:17:02
--- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> Why would anyone want an uninitialized vector? One legitimate
reason is that
> you have an existing C-style library function 'f' that will
Of course purely for performance reasons.
> I don't see how the iterator interface can be used to achieve the
> effect. If the current vector interface is enough, why all this
> uninitialized values?
std::vector<double> > vec(10000000);
// here is an algorithm that fills vec with the result of
// some complex algorithm.
Doesn't it seem glaringly stupid that there is no way
of avoiding the initialization?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk