readonly?

Ali Çehreli acehreli at yahoo.com
Tue Jul 10 15:58:39 PDT 2012


On 07/10/2012 03:53 PM, Namespace wrote:
>> const(T)* ?
>
> Example?

class Bar
{}

class Foo
{
     const(Bar) * _b;

     void SetBar(const(Bar) * b) {
         _b = b;
     }
}

void main()
{
     auto b = new Bar();
     auto f = new Foo();
     f.SetBar(&b);
}

Ali


More information about the Digitalmars-d-learn mailing list