Boost logo

Boost :

Subject: Re: [boost] Is there interest in copyable type_info that does notrequire RTTI (was: Is there interest in typeid(TYPE).name()like function that does not require RTTI)
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-05-31 12:46:33


Daniel Larimer wrote:
> Yes there is interest. I would like to disable RTTI but cannot
> because of boost::any and boost::function.
>
> I even wrote my own 'typeinfo' template/macro that allows me to
> register all of the types I care about. I think having the ability
> to 'override' the value returned, perhaps a pretty_name(), such that
> get_template_info<std::string>().pretty_name() => "std::string" or
> perhaps even "string" would be useful.
>
> This almost gets into some basic level of reflection. The ability
> to query 'parts' of the name may be useful... such as
> get_template_info<std::string>().namespace() => "std"
>

Hmmm - this looks pretty similar to the "extended_type_info" facility
which is documented as part of the serialization library. This
facility was required to implement loading of derived classes
through a base class pointer. It includes a class factory which
constructs a class instance at runtime given it's name as a string.

The (sub)library includes multiple implementations. One
is based on rtti and another one similar to that described above.

Robert Ramey


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