digitalmars.D.bugs - Bug or Missing Feature? : Static assert about const structs
- Russell Lewis (11/11) Feb 27 2007 The following code fails to compile:
The following code fails to compile:
struct Foo {
int x;
};
const Foo var = { 3 };
static assert(var.x == 3);
That is, you cannot make assertions about the values of members of const
structs. Does anybody know whether this is a bug in the compiler, or
just a missing feature in the language? It seems like this would be
easy enough to implement, and if it worked my compile-time string
tokenizer would be a lot easier to write!
Feb 27 2007








Russell Lewis <webmaster villagersonline.com>