Cannot have properties on const references?

simendsjo simendsjo at gmail.com
Sat Sep 24 11:10:48 PDT 2011


Sorry about the possible double post. I cannot see my previous..

struct S {
     @property int B() {
         return 1;
     }
}

void main() {
     S s1;
     auto a1 = s1.B; // ok
     const(S) s2;
     auto a2 = s2.B; // Error: function t.S.B () is not callable using 
argument types ()
}


More information about the Digitalmars-d-learn mailing list