__traits and determining all overridable functions

Christopher Wright dhasenan at gmail.com
Mon Nov 12 10:12:08 PST 2007


Steven Schveighoffer wrote:
> "Christopher Wright" wrote
>> You can't foreach an array at compile time, and __traits(allMembers) 
>> returns an array. You can index an array at compile time, but again, you 
>> can't use a while loop at compile time.
>>
>> You have to use recursion.
>>
>> Eventually, static foreach should be able to do this. Or you can bug 
>> Walter about changing allMembers to return a tuple of strings.
>>
> 
> Is static foreach a planned feature?  This sounds like it would be much 
> preferrable to the recursion.

Yes. But not quite yet. There's a ticket for it.



More information about the Digitalmars-d mailing list