Google's Go

Ali Çehreli acehreli at yahoo.com
Mon Jan 25 19:45:10 PST 2010


Steven Schveighoffer wrote:
 > On Sun, 24 Jan 2010 04:25:21 -0500, grauzone <none at example.net> wrote:

 > Templates won't work here, you cannot template the 'this' pointer.  So
 > you end up with 3 identical implementations, and *no* const guarantee on
 > the mutable one:
 >
 > @property C c() { return _c; }
 > @property const(C) c() const { return _c; }
 > @property immutable(C) c() immutable { return _c; }

Is there a known bug in 2.039 about this feature? It doesn't seem to 
consider the hidden this parameter:

class C {}

struct S
{
    C _c;

     @property inout(C) c() inout
     {
         return _c;
     }
}

Error: inout on return means inout must be on a parameter as well for 
inout inout(C)()

Ali



More information about the Digitalmars-d mailing list