|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-03-08 12:59:53
"Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> writes:
> "David Abrahams" <dave_at_[hidden]> wrote
>
>> > Now if there will be the assignment idiom
>> > applied the front-most will be assigned to the new one
>> > - it will be not destroyed (no destructor will be
>> > called). IMHO this is not correct. The old element
>> > will not disappear - just its value/state will be
>> > different. I think that the overwrite operation means
>> > destruction of the old object, NOT assignment. What do
>> > you think?
>>
>> I think it introduces inefficiencies that most people won't want to
>> pay for, and I don't see any benefits other than lifting the
>> requirement on assignability. Types that are copiable but not
>> assignable are rare, though, at least in my experience.
>>
> I think you are missing the point:
Actually, no. I realized you're making the argument below.
> object pushed out of circular_buffer because container got full must
> be destroyed.
Why? I mean, the only reason I can see for that requirement is an
aesthetic one. I don't see any logical foundation for the assertion.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk