On Wednesday, 2 September 2020 at 21:40:59 UTC, Steven Schveighoffer wrote:
What they can do is template the `this` parameter. Then if the underlying range supports calling that way, it will work, otherwise it won't.

using `template this` should be compatible with the existing code I would think.

Thanks! I've never looked much into template this -- at first glance, it offers what inout already offers -- but it sounds like the right tool for the job. (inout would straightaway disallow calls to mutable methods.)

https://dlang.org/spec/template.html#template_this_parameter

I'll experiment with it!

-- Simon

Reply via email to