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

Timon Gehr timon.gehr at gmx.ch
Fri Sep 9 14:55:08 PDT 2011


On 09/09/2011 11:45 PM, Andrej Mitrovic wrote:
> class Foo
> {
>      this()
>      {
>          value = true;
>      }
>
>      @property bool value() { return true; }
>      @property void value(bool value) { }
> }
>

class Foo
{
     this()
     {
         value = true;
     }

     @property bool value() const { return true; } // const
     @property void value(bool value) { }
}



More information about the Digitalmars-d-learn mailing list