Boost logo

Boost :

Subject: Re: [boost] [Root Pointer] New Documentation
From: work (Vladimir.Batov_at_[hidden])
Date: 2016-04-11 01:32:02


On 2016-04-11 14:25, Gavin Lambert wrote:
> On 11/04/2016 16:08, Phil Bouchard wrote:
>>> Still, if you insist... How about:
>>>
>>> struct sort
>>> {
>>> bool operator(T const& p1, T const& p2) { return &p1 < &p2; }
>>> }
>>>
>>> std::set<T, sort> all_;
>>>
>>> Now "remove" won't need to do linear search.
>>
>> It's still O(log(n)) whereas note_ptr is O(1).
>
> Unless I'm missing something, node_ptr doesn't implement a remove
> operation at all. You just discard the node_ptr when you aren't
> interested in it any more, and memory isn't released until the
> root_ptr is.

Ouch. No offence to the author but that certainly seals it for me.
Giving up resource management for anything serious and long-running
sounds like a professional suicide.


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