CTFE & enums & static assert

Robert M. Münch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 4 09:21:59 PDT 2015


I find this a bit strange:

// get all rules that start with p...
enum BolRules = StaticFilter!(beginsWithP, __traits(allMembers,BolSource));
static assert(is(BolRules == enum));

Compiling using dmd...
source/app.d(114): Error: static assert  (is(BolRules == enum)) is false

I'm trying to construct an enum that can be used in a "final switch" to 
check if all cases were handled. But so far it's not working, because I 
can't get the enum constructed.

-- 
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



More information about the Digitalmars-d-learn mailing list