C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] Multidimensional subscript operator

From: Uecker, Martin <Martin.Uecker_at_[hidden]>
Date: Mon, 26 Apr 2021 05:51:32 +0000
Am Montag, den 26.04.2021, 07:45 +0200 schrieb Jens Maurer via Liaison:
> On 26/04/2021 00.31, will wray via Liaison wrote:
> > auto&& e = a[i]; // retains lvalueness
> > // suboptimal for proxy
>
> What's suboptimal about the proxy case here?
>
> This seems to get way off-topic for the liaison list, btw.
>
> The only part of the proposal that affects the common
> subset of C and C++ is the fact that the comma operator
> can no longer be used unparenthesized inside [].
>
> Other than that, this is a user-defined overloaded operator,
> a feature that C doesn't have. Hardly any extension for
> built-in types that C might contemplate is precluded by that.


If C++ adopts this proposal now and encourages use of a[3,2] for
multi-dimensional indexing, then later people would not
object if C decides to use the syntax a[3,2] for something
else for C arrays?


Best,
Martin


Received on 2021-04-26 00:51:43