Compiler patch for runtime reflection
Alex Rønne Petersen
xtzgzorex at gmail.com
Sun Oct 23 09:17:45 PDT 2011
On 23-10-2011 18:03, Robert Jacques wrote:
> On Sun, 23 Oct 2011 07:06:42 -0400, Timon Gehr <timon.gehr at gmx.ch> wrote:
> [snip]
>> The module can generate RTTI for all types recursively from the starting
>> point iff that information is statically available. It does not have to
>> be. A module that comes as .di + static library binary could return a
>> reference to a private class that has a publicly exported base class.
>> How would you generate RTTI for a statically invisible class?
>
> You're not supposed to be able to. Runtime reflection should only apply
> to public data members.
I don't think that's necessarily a good idea. If you're doing something
related to e.g. serialization and a type uses properties to hide fields
(say, because the properties have in/out contracts), you would be unable
to take those into account.
- Alex
More information about the Digitalmars-d
mailing list