WTF! new in class is static?!?!

aliak something at something.com
Thu Jun 7 22:43:50 UTC 2018


On Thursday, 7 June 2018 at 21:32:54 UTC, Jonathan M Davis wrote:

> struct S
> {
>     int* ptr = new int(42);
> }
>

Is that supposed to compile? -> https://run.dlang.io/is/SjUEOu

Error: cannot use non-constant CTFE pointer in an initializer 
&[42][0]


More information about the Digitalmars-d-learn mailing list