C++ Logo


Advanced search

Re: [wg14/wg21 liaison] Multidimensional subscript operator

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Mon, 26 Apr 2021 16:53:44 +0300
On Mon, 26 Apr 2021 at 16:23, will wray via Liaison
<liaison_at_[hidden]> wrote:
> I see agreement here that a[i...] is valuable syntactic turf.
> Therefore, caution should be exercised here.
> As the authors say - "the timeline is aggressive".
> Waiting a cycle would be prudent, to allow appropriate reflection.

Waiting a cycle doing what? C++20 deprecated the use of comma in brackets
to pave way for this proposal. We have already waited a cycle.

> After all, P2128 offers no new functionality with operator[]
> "Both its use and definition would match that of operator()."

That *is* new functionality. A multi-parameter index operator allows
expressing things
that couldn't be expressed before (#1).

> But should it? Nothing is broken, for now.

What is broken is the inability to make the distinction between
indexing and calling
when there are multiple parameters, when that distinction can be made
for one parameter.

> The generalisation adds nothing yet devalues alternative meanings.

See (#1), again.

> It is a waste of committee time. There are many more important things.

Such as? We do not operate in a manner where vague suggestions of
subjective priority
quiesce discussions of proposals.

> EWG asked for more motivation. None was provided.

I don't see how that's correct, because R5 adds the motivation that
EWG asked for,
comparing to R4.

> I disagree. The harm is insidious.
> It's stated motivating use case damages expectations.

What expectations does it damage, and how?

> It tends to perpetuate a particular world view. It devalues.

You mean it devalues ideas that haven't been proposed yet, and
possibly never will?

> The sentence that Martin highlighted, and it's updated version,
> appear to show a lack of knowledge of C array fundamentals.

I'm not sure why that matters. C++ array-ish types are very different
from C arrays,
leaving C arrays the odd and irregular corner case.

> It is yet another example of a well-meaning proposal,
> poorly motivated and not sufficiently thought through,
> yet likely to be accepted as a cool new bit of syntax.

Well, there are certainly different takes on how well this proposal is

Received on 2021-04-26 08:53:57