On Sat, Nov 7, 2009 at 10:40 PM, Don nos...@nospam.com wrote:
You can create them without templates. std.metastrings was created before
CTFE existed, it's rather outdated. It's intended for use with template
metaprogramming, not for use with CTFE.
I posted about this the other day, wouldn't
Don Wrote:
You can do stuff like:
struct Foo {
int x;
}
enum Foo b = Foo(56);
strange. you can do that only if there is no constructor.
Also trying with templates, i got a segfault, i dont know if it is already
reported.
Why this segfaults?. At least it should print a error
g wrote:
Don Wrote:
You can do stuff like:
struct Foo {
int x;
}
enum Foo b = Foo(56);
strange. you can do that only if there is no constructor.
It also works with opCall. ctor calls don't yet work in CTFE calls from
module scope (works OK inside a function) -- structural problem
At what point structs are supported in CTFE.
Cause this fails in dmd 2.036:
import std.metastrings;
pragma(msg,toStringNow!(A.init.a));
struct A{
uint a;
}
with this message (note that the end seems truncated):
g...@g-desktop:~/Documentos/NCHESS$ dmd oh
oh.d(3): Error: no property 'a' for
g wrote:
At what point structs are supported in CTFE.
Cause this fails in dmd 2.036:
import std.metastrings;
pragma(msg,toStringNow!(A.init.a));
struct A{
uint a;
}
with this message (note that the end seems truncated):
g...@g-desktop:~/Documentos/NCHESS$ dmd oh
oh.d(3): Error: no