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 MemberFunctionAttribute list[2]. Is there no further description of the behaviour with the inout attribute other than for parameters[1] in the spec? There's an empty 19.10.10 point without content[3] : D. Maybe a placeholder?

[1]: https://dlang.org/spec/function.html#inout-functions
[2]: https://dlang.org/spec/function.html#MemberFunctionAttribute
[3]: https://dlang.org/spec/function.html#inout-functions

Reply via email to