digitalmars.D.learn - IndexExpression
- Ellery Newcomer (5/5) Jan 19 2009 IndexExpression:
- Jarrett Billingsley (12/16) Jan 19 2009 You're precisely right.
IndexExpression: PostfixExpression [ ArgumentList ] The only place I can think of ArgumentList containing more than one element is in some sort of overloaded operator case. Is there some feature I'm missing out on?
Jan 19 2009
On Mon, Jan 19, 2009 at 12:57 PM, Ellery Newcomer <ellery-newcomer utulsa.edu> wrote:IndexExpression: PostfixExpression [ ArgumentList ] The only place I can think of ArgumentList containing more than one element is in some sort of overloaded operator case.You're precisely right. class Foo { void opIndexAssign(int value, int a, int b) { Stdout.formatln("a = {}, b = {}, value = {}", a, b, value); } } auto f = new Foo(); f[3, 4] = 5; // prints "a = 3, b = 4, value = 5"
Jan 19 2009