Re: Inference of auto storage classes for interface function return type

2018-07-04 Thread ag0aep6g via Digitalmars-d-learn
On 07/04/2018 05:59 PM, Timoses wrote: There's an empty 19.10.10 point without content[3] : D. Maybe a placeholder? [...] [3]: https://dlang.org/spec/function.html#inout-functions Just a bug. https://github.com/dlang/dlang.org/pull/2407

Re: Inference of auto storage classes for interface function return type

2018-07-04 Thread Timoses via Digitalmars-d-learn
On Wednesday, 4 July 2018 at 15:12:15 UTC, Jonathan M Davis wrote: You can make opIndex inout instead of const. That way, inout applies to the invisible this reference, just like it would with const. Awww, thanks! I was kinda hovering around this[1] section and didn't quite see the

Re: Inference of auto storage classes for interface function return type

2018-07-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, July 04, 2018 14:07:35 Timoses via Digitalmars-d-learn wrote: > How can I return inferred storage class from interface functions? > I can't use auto as return value in interface. Neither can I use > "inout" as I don't pass a parameter. > > // Ref Type > interface IRef > { >

Re: Inference of auto storage classes for interface function return type

2018-07-04 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 4 July 2018 at 14:07:35 UTC, Timoses wrote: How can I return inferred storage class from interface functions? I can't use auto as return value in interface. Neither can I use "inout" as I don't pass a parameter. // Ref Type interface IRef {

Inference of auto storage classes for interface function return type

2018-07-04 Thread Timoses via Digitalmars-d-learn
How can I return inferred storage class from interface functions? I can't use auto as return value in interface. Neither can I use "inout" as I don't pass a parameter. // Ref Type interface IRef { Ref opIndex(size_t idx) const; } class