const, auto and struct/class methods

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Mon Nov 25 01:41:13 PST 2013


On 25/11/13 10:13, Andrea Fontana wrote:
> auto bar() { return cast(const int) 10; }
>
> writeln(typeid(bar()));

Yup, I should have added that I would prefer to avoid a cast in the return 
statement :-)  Thanks anyway!



More information about the Digitalmars-d-learn mailing list