const property don't wont return const reference to value

Zhenya zheny at list.ru
Sun Dec 23 05:38:15 PST 2012


On Sunday, 23 December 2012 at 13:37:33 UTC, Rainer Schuetze 
wrote:
>
>
> 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

Thank you very much!


More information about the Digitalmars-d-learn mailing list