www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - IndexExpression

reply Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
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
parent "Jarrett Billingsley" <jarrett.billingsley gmail.com> writes:
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