Boost logo

Boost :

Subject: Re: [boost] [Boost.Pool] TR1?
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-04-12 11:33:44


On Tue, Apr 12, 2011 at 11:15 AM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> AMDG
>
> On 04/12/2011 08:04 AM, Dave Abrahams wrote:
>>
>> On Apr 12, 2011, at 3:54 AM, Phil Bouchard<philippe_at_[hidden]>  wrote:
>>
>>> On 4/11/2011 11:19 PM, Nevin Liber wrote:
>>>>
>>>> But it may be undefined behavior to pass that pointer to is_from.
>>>
>>> That's right but I am not sure about the complexity in making its
>>> behavior
>>> non-undefined even if the complexity is not constant.  Because otherwise
>>> is_from() would be quite useless
>>
>>
>> I think you are severely missing the point: it is not implementable, no
>> matter the cost in complexity, without causing undefined behavior. You're
>> just not allowed to compare arbitrary pointers with<, and the total
>> ordering produce by std::less isn't guaranteed to be meaningful.
>>
>
> Sure it's implementable.  You just have
> to compare it for /equality/ with every
> address inside the pool.  You should be
> able to enumerate them.

Hahaha, you're quite right! It's implementable, but could be really
expensive. Thanks for the correction.

I wonder if compilers will optimize away the loop?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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