Boost logo

Boost :

Subject: Re: [boost] [any] new version
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-09-04 12:00:33


on Sun Sep 04 2011, Andrey Semashev <andrey.semashev-AT-gmail.com> wrote:

> On 09/04/2011 11:32 AM, Artyom Beilis wrote:
>>
>
>>> What if we keep the pointer to the type_info in impl, but make it
>>> directly accessible, not via a virtual call? This would keep sizeof(any)
>>> to one pointer and only add one indirection to any4. IMHO, that would be
>>> the best solution.
>>>
>>
>> This is fine as well. However I don't see too much advantage
>> of having one pointer instead of two.
>
> Empty anys will take less space, which may be significant. Moving and
> swapping will also be cheaper.

+1

-- 
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