[Issue 2628] obj[n] not allowed for user-defined tuples

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 28 08:31:40 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2628





------- Comment #4 from kamm-removethis at incasoftware.de  2009-01-28 10:31 -------
What about allowing a template signature for opIndex

T opIndex(size_t i)();

that is only valid if there's no classical opIndex defined. For types with such
an opIndex, rewrite instance[j] as instance.opIndex!(j)() for compile-time
constant indices. opSlice could get the same treatment.

While it'd still be a special case, it'd be one that could just be added to the
list of operator overloads without confusing people unduly.


-- 



More information about the Digitalmars-d-bugs mailing list