Changing the behavior of the comma operator

Steven Schveighoffer schveiguy at yahoo.com
Thu Mar 27 05:38:36 PDT 2014


On Thu, 27 Mar 2014 00:35:38 -0400, deadalnix <deadalnix at gmail.com> wrote:

> On Thursday, 27 March 2014 at 02:08:50 UTC, Steven Schveighoffer wrote:
>> On Wed, 26 Mar 2014 17:32:00 -0400, Nick Sabalausky  
>> <SeeWebsiteToContactMe at semitwist.com> wrote:
>>
>>> On 3/26/2014 7:44 AM, "Marc Schütz" <schuetzm at gmx.net>" wrote:
>>>> This is valid in both C and C++:
>>>>
>>>>   i, j = 0, 1;
>>>>
>>>> It is equivalent to the following:
>>>>
>>>>   i;
>>>>   j = 0;
>>>>   1;
...
>> '=' has precedence over ','.
>>
>
> I think you get operator priority wrong and it will be (i), (j = 0),  
> (1). I added extra () to show how operator priority works.

I think that's what I said, no?

-Steve


More information about the Digitalmars-d mailing list