__traits and determining all overridable functions

Robert Fraser fraserofthenight at gmail.com
Mon Nov 12 16:25:40 PST 2007


Christopher Wright Wrote:

> You can't foreach an array at compile time [...]

Yes you can, in the context of a function.

string ct_func(string[] arr)
{
   foreach(s; arr)
   { ... }
}

mixin(ct_func(__traits(allMembers, Foo)));



More information about the Digitalmars-d mailing list