Annotating SortedRange.empty const: Best way to auto-deduce annotations?
eiderdaus at gmail.com
Wed Sep 2 22:08:56 UTC 2020
On Wednesday, 2 September 2020 at 21:40:59 UTC, Steven
> 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.)
I'll experiment with it!
More information about the Digitalmars-d-learn