Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-04-27 17:41:51


"Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> wrote in message
news:d4ooik$f0h$1_at_sea.gmane.org...
>
>> you're analogy with vector<string> don't quite fit IMO. assigning
>> vector<string> might be quite efficient with very few
>> heap-allocations taking place; assigning ptr_vector<Foo> would cost the
>> same
>> as copy-construction + deallocation.
>
> IMO no performance point could justify omitting assignment operator. If I
> need vector<ptr_vector<Foo> > - it's my decision and I will deal with
> performance penalties.

I agree very much with Gennadiy and others who argue that performance
concerns should not cause an otherwise useful operation to be omitted.

Some programs know in advance that they will never see large (in relation to
processor speed or memory) numbers of elements in a particular container.
The main considerations are convenience and functionality, not performance.

"Premature optimization is the root of all evil." Hoare, Knuth

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk