Delayed const variable initialization

Yuxuan Shui via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 13 00:11:32 PDT 2015


How can I do something like this?

const(A) x;
if (condition) {
   x = func1();
} else {
   x = func2();
}

This is a valid use case, and to make this work I'll have to use 
Rebindable, which is really inconvenient.


More information about the Digitalmars-d-learn mailing list