bug with std.range.zip? range with opEquals(const) const not allowed inside zip

Jonathan M Davis jmdavisProg at gmx.com
Mon Aug 27 00:49:31 PDT 2012


On Monday, August 27, 2012 09:42:34 Jens Mueller wrote:
> Aha. I see.
> Then we get down from four declarations to two by writing
> bool opEquals(const auto ref S rhs) const {...}
> and
> bool opEquals(auto ref S rhs) {...}
> 
> And with inout probably even further:
> bool opEquals(inout auto ref S rhs) inout {...}
> 
> Thanks for explaining.

auto ref _only_ works with templated functions, and I'm not sure if it even 
works to templatize opEquals (it might; it might not). So, while auto ref 
helps in some cases, in many it does not.

- Jonathan M Davis


More information about the Digitalmars-d mailing list