Re: C++ Reflection package?

Lieven Marchand <>
3 Apr 1999 21:57:20 -0500

          From comp.compilers

Related articles
C++ Reflection package? (Mihai Christodorescu) (1999-04-01)
Re: C++ Reflection package? (Lieven Marchand) (1999-04-03)
Re: C++ Reflection package? (Hao-yang Wang) (1999-04-03)
Re: C++ Reflection package? (Olivier Lefevre) (1999-04-06)
| List of all articles for this month |

From: Lieven Marchand <>
Newsgroups: comp.compilers
Date: 3 Apr 1999 21:57:20 -0500
Organization: Only under extreme pressure
References: 99-04-004
Keywords: C++

Mihai Christodorescu <> writes:

> I was wondering whether there is such a beast as a reflection
> (in the Java DevKit sense) library for C++. As far as I can figure out
> (and I have not spent too much time on the topic), one would be able
> to extract such information only from object files / shared libs that
> were compiled with debug info. I know RTTI lets you query whether an
> object is of a certain type. But I want to extract some textual
> information about the class.

Before Java called it reflection Lispers called stuff like that a meta
object protocol. An implementation for C++ is OpenC++ at

One comprehensive starting point for MOPs is although they
have now broadened their research to a concept they call Open

PS: I presume you are aware that RTTI only is guaranteed to work on
classes with at least one virtual function?

> PS. On a completely different topic, is it possible to manipulate
> namespaces in C++ (i.e. add/remove/replace classes in a namespace)?

Do you mean at compile time or at run time? I think the name lookup
rules for C++ are too complex to allow manipulating namespaces at run
time. It would force an interpreter based system since you would have
to reparse everything to know to what the functions resolve to after
changing anything in a namespace.

Lieven Marchand <>

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.