Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-12-17 19:06:47


"craigp_at_[hidden]" <craigp_at_[hidden]> writes:

> Can you elaborate on compile-time reflection? We have the type-traits
> library, which may be an example what you have in mind. But this will
> always be limited without further compiler support.

The compile-time reflection capabilities of C++ are impressive, but
still quite limited. For example, I'd like to be able to find out
about all of the members and member functions of a class, and all of
the free functions declared in a namespace.

> It would be ideal to see some kind of typeof operator added to the
> C++ standard.

Heh. typeof would be nice but it barely scratches the surface of
the possible and missing reflective capabilities.

> In the meantime (which could be a loong time ;-), I'd like a
> workable reflection framework. Whether it belongs to Boost is
> certainly an open question, however.
>
> A reflective framework could be in three stages: a preprocessing stage
> (which creates the reflection data), an optional code
> generation/transformation stage, then a compilation stage. In this sense,
> it would be both a compile and run-time framework.

Sounds like a great idea to me.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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