const property don't wont return const reference to value

Rainer Schuetze r.sagitario at gmx.de
Sun Dec 23 05:37:32 PST 2012



On 23.12.2012 14:20, Zhenya wrote:
>      @property const ref int bar() const

The first const does not bind to the return type, but to the whole 
declaration, so it does the same as the const at the end. You should use

     @property ref const(int) bar() const


More information about the Digitalmars-d-learn mailing list