Steven Schveighoffer wrote: <snip>
Unlike some languages, D1 const does not imply static. Which means you are trying to define an S as containing an S, which would then contain another S and so on. This should work:
It's implying static in this context according to my testing. Try this at home:
---------- import std.stdio; const S S1 = S(); struct S { float value; static S opCall() { S s; s.value = 42; return s; } const S S2 = S(); } pragma(msg, S.sizeof); pragma(msg, S1.value); pragma(msg, S.S2.value); ----------