Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-03-28 16:54:01


Very interesting. As far as use cases, one might take a look at
extended_type_info in the serialization library. It seems related to this.

Robert Ramey

Emil Dotchevski wrote:
> On Fri, Mar 28, 2008 at 11:26 AM, Mathias Gaunard
> <mathias.gaunard_at_[hidden]> wrote:
>> Boost.variant provides visitation over an object whose types is
>> within a certain set.
>> To identify the type of the object, it uses an additional int that
>> uniquely identifies the type of the object within the set.
>>
>> However, RTTI already provides unique identification for objects of
>> polymorphic types within all types.
>
> The typical use of a variant is to hold objects of types with value
> semantics. Most such types are not polymorphic and so dynamic RTTI can
> not be used to tell them apart.
>
> Could you provide more info about your specific use case? Could you
> use boost::any and dispatch based on RTTI?


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