Gregory Colvin <[EMAIL PROTECTED]> writes:

>> Also, if shared_ptr only needs to allocate at construction time (I'm
>> not sure of this) we can avoid storing the allocator at all.
>
> Then how to deallocate?

Using the custom deleter?

>>> I'm reeling from the implication that the following is undefined
>>> behavior for non-POD T:
>>>
>>>     T* p = (T*)malloc(sizeof T);
>>>
>>> Are you sure?
>>
>> Nope.  3.8/5 shows that I'm wrong.
>
> That's a relief.
>
>>  It still doesn't make any sense to
>> return a T* from allocate since normally with a non-singular T* p,
>> either p == 0 or *p refers to a constructed T.
>
> The idea was that Allocator<T>::pointer might be a proxy type
> that cannot be converted to void* and back, so allocate() must
> return and construct() must take an Allocator<T>::pointer rather
> than a void*.

Wow, creepy.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to