How do I create a module-local immutable class object?

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Sep 9 14:41:35 PDT 2011


On 9/9/11, bearophile <bearophileHUGS at lycos.com> wrote:
>
> private class Foo {}
> immutable Foo foo1;
>
> static this() {
>     foo1 = new immutable(Foo);
> }

Oh right, that's the syntax. Thanks!


More information about the Digitalmars-d-learn mailing list