January 19, 2009 IndexExpression | ||||
---|---|---|---|---|
| ||||
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? |
January 19, 2009 Re: IndexExpression | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | 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"
|
Copyright © 1999-2021 by the D Language Foundation