Boost logo

Boost :

Subject: Re: [boost] [DynamicAny] Feedback
From: joaquin_at_[hidden]
Date: 2011-03-04 06:46:44


Stewart, Robert escribió:
> joaquin_at_[hidden] wrote:
>
>> Daniel Larimer escribió:
>>
>>
>>> I recently ran into a problem where I wanted to retrieve
>>> the value stored in a boost::any by casting to a base class.
>>> Unfortunately, boost::any requires you cast out the exact
>>> type as that held.
>>>
>>> Boost.DynamicAny is a vairant on Boost.Any which provides
>>> more flexible dynamic casting of the underlying type. Whereas
>>> retreiving a value from Boost.Any requires that you know the
>>> exact type stored within the Any, Boost.DynamicAny allows you
>>> to dynamically cast to either a base or derived class of the
>>> held type.
>>>
>> What's the trade-off? I mean, does Boost.DynamicAny use more
>> memory than Boost.Any, is it slower?
>>
>
> I presume you mean other than the difference between static_cast
> and dynamic_cast?
>
> Couldn't this functionality be added to Boost.Any itself? That is,
> add another cast that does dynamic_cast so there's only one
> library but clients get a choice about how to extract values.
>

That is exactly my point.

Joaquín M López Muñoz
Telefóinca, Investigación y Desarrollo

Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at.
http://www.tid.es/ES/PAGINAS/disclaimer.aspx


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