DeRailed DSL (was Re: compile-time regex redux)
Lionello Lunesu
lio at lunesu.remove.com
Mon Feb 12 07:15:16 PST 2007
Kirk McDonald wrote:
> Walter Bright wrote:
>> Kirk McDonald wrote:
>>> Given a class, I need a way to get a list of all of its member
>>> functions at compile-time.
>>
>> static member functions? non-virtual member functions?
>
> Okay, I think I do need to clarify this.
>
> Let's take this class:
>
> class Foo {
> void foo() {} // A regular method
> static void bar() {} // A static member function
> final void baz() {} // A non-virtual member function
> }
>
> Here's one possible interface:
>
> get_member_functions!(Foo) => Tuple!(Foo.foo, Foo.bar, Foo.baz)
>
> To distinguish between these attributes, we could define an enum, like:
>
> enum MemberAttribute { Virtual, Final, Static }
I think you should be able to use .mangleof to get that info, no?
L.
More information about the Digitalmars-d
mailing list