Possible bug - should the following code cause an access violation exception?

Afshin davidnia1 at gmail.com
Sun Dec 29 22:38:49 PST 2013


module test;

class Foo {
     public static ulong next = 0;

     public static ulong getNext() {
         return next++;
     }
}

void main() {
     Foo.getNext();
}

/*
The next++ is the culprit.
Using a ++next does not throw an exception.
*/


More information about the Digitalmars-d-learn mailing list