[Issue 7753] Support opIndexCreate as part of index operator overloading in user-defined types

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri May 29 10:47:36 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=7753

--- Comment #7 from Martin Nowak <code at dawg.eu> ---
(In reply to Martin Nowak from comment #6)
> Igor Stepanov suggested [ยน] an opIndex extension.
> 
> ref Foo opIndex(bool lvalue)(size_t idx)

A separate opIndexCreate might be better, b/c it allows you to 
have a ref return for one and an rvalue return for the other 
function. It also allows to use those operands as polymorphic 
functions in classes.

--


More information about the Digitalmars-d-bugs mailing list