Non compile time evaluation for initializers

Janice Caron caron800 at googlemail.com
Thu Oct 25 23:39:12 PDT 2007


On 10/25/07, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> Is there a good reason why the compiler does not allow non-CTFE initializers
> for non-const variables?

So you're saying that, in general, if

    X x = y;

won't compile, then the compiler should rewrite it as

    X x;
    static this
    {
        x = y;
    }

Makes sense to me!



More information about the Digitalmars-d mailing list