Signed-unsigned comparisons in Phobos

Timon Gehr timon.gehr at gmx.ch
Fri Aug 12 16:08:00 PDT 2011


On 08/13/2011 12:37 AM, Ellery Newcomer wrote:
> On 08/12/2011 04:06 PM, Don wrote:
>>
>> No, it was specifically disallowed.
>>
>> Version D 2.037 Dec 3, 2009
>> New/Changed Features
>> No more comma operators allowed between [ ].
>
> I think that was for type declarations, not index expressions.
>
> you can still do this:
>
> import std.stdio;
> struct X{
> void opIndex(int i, int j){
> writeln(i, " ", j);
> }
> }
> void main()
> {
> X x;
> x[1,2];
> }

Ah ok, I did not see this post before. This makes everything clear. Thanks!


More information about the Digitalmars-d mailing list