digitalmars.D - allMembers trait for module
- ketmar via Digitalmars-d (24/24) Oct 14 2014 Hello.
Hello.
i really really wonder if the following program should ouput what it
outputs:
version =3D wtf;
string listit(alias mod) () {
foreach (m; __traits(allMembers, mod)) {
pragma(msg, m);
}
return "";
}
enum s =3D listit!(mixin(__MODULE__));
i see this:
object
wtf
listit
s
the question is: wtf "wtf" is doing here?!
two supplement questions:
1. if it's intended to work like this, why we don't have
isVersionSymbol trait?
2. where is isModuleSymbol trait, for that matter? hacks with
'compiles' aren't funny (and can stop working any time).
and the main question: who i need to kill for such traits to be
approved for acception?
Oct 14 2014








ketmar via Digitalmars-d <digitalmars-d puremagic.com>