invariant

Gide Nwawudu gide at btinternet.com
Wed May 13 07:57:44 PDT 2009


On Tue, 12 May 2009 14:50:26 -0400, saotome
<saotome.ran at googlemail.com> wrote:

>Hi all,
>
>i want to declare an invariant interger, for instance "invariant int x = 3;". But i've got this error while compiling.
>
>Error: constant 3 is not an lvalue
>
>could someone explain me what's wrong here ? I'm using dmd 2.030

Not sure the following code works for me.

invariant int x = 3;
void main() {
}

Gide


More information about the Digitalmars-d-learn mailing list