C++ Logo


Advanced search

Re: [wg14/wg21 liaison] Multidimensional subscript operator

From: Philipp Klaus Krause <krauseph_at_[hidden]>
Date: Mon, 26 Apr 2021 20:05:25 +0200
Am 26.04.21 um 13:18 schrieb Jens Maurer via Liaison:
>> postfix-expression [ expression ]
>> to
>> postfix-expression [ assignment-expression ]
>> Such a change would be better in line with the function operator, for
>> example, that also only has assignment-expression, here.
> Sounds good, if WG14 is happy with the backward compatibility break here.

Making formerly correct code (i.e. using a comma operator in a array
index) illegal for something that as far as I see, basically is just
syntactic sugar (a[i,j] vs a[i][j]) doesn't look like something
WG14-like to me.

For comparison:
We had the proposal (by me, so I might be biased) to change the return
type of strerror from char * to const char *, which would help avoid
errors, and more clearly convey what is stated in the descirption of
strerror anyway. The change got thrown out by WG14 because it could
result in a warning in badly-written software; that warning was
considered an unacceptable break of backwards compability by WG14
(though the strong POSIX veto also contributed to that decision).


Received on 2021-04-26 13:05:35