Boost logo

Boost :

From: nbecker_at_[hidden]
Date: 2002-03-06 14:20:41


>>>>> "rwgk" == rwgk <rwgk_at_[hidden]> writes:

    rwgk> --- In boost_at_y..., "Stewart, Robert" <stewart_at_s...> wrote:
>> > Unfortunately the reserve() solution eventually requires
>> > use of push_back(), which is also slow.
>>
>> If you use push_back() following reserve(), there is no performance
    rwgk> penalty.
>> The push_back()'ed object is copied into the next element. If you
    rwgk> exceed
>> the size allocated with reserve(), then push_back() will cause
    rwgk> reallocation
>> and copying, so be sure to choose the right size when calling
    rwgk> reserve().

    rwgk> Here is an example push_back() implementation:

I'm afraid I don't see the relevence. I believe complex should not
require workarounds to avoid calling a default constructor. Am I
missing something?


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