I am working a reflection / introspection library (dynamic / at runtime, as opposed to compile time with template and mixin).

Now I can create "PropertyInfo" classes for property with very little code and it all works well.

I'm hitting a problem, trying to "register" all property of my class automatically.

I have a vanilla implementation like that:
=====
void RegisterProperties(T)()
{
   foreach(mn ; __traits(derivedMembers, T))
       GetProperty!(T, mn);
}
=====

The problem is, it's trying to register private properties! (and of course fail, due to access rights...)
So far I have test like
===
static if(mixin("__traits(compiles, t." ~memberName ~")") )
{
   getter = &GETTER!(T, memberName);
}
====
which test that the thing is a property.
But how could I test it's a ***public*** property?
if not possible, wouldn't it be a nice trait addition?

Reply via email to