C++ Logo

std-proposals

Advanced search

Re: Attribute view

From: Martin Küttler <mkuettle_at_[hidden]>
Date: Fri, 20 Dec 2019 03:49:19 +0100
Hi again,

> Conditional view
> ----------------
>
> To accommodate "view-correct" template code, a form of conditional
> view-ness is needed. This requires a syntax to request the presence of
> the argument at the n-th parameter of a specific function. I do not yet
> have decided how that should look.

I changed my mind partly. I think requiring recursive use of view, while
necessary for correctness, introduces a set of problems, and is not
worth the hassle. That also alleviates much of the need for a
conditional view, which seems impractical as well. I think allowing
(instead of requiring) the use of view in normal functions is a more
realistic idea, and already yields much of the benefit.

What exactly this benefit is, is not quite clear yet. In the last email
I argued for basically the same semantics as assigning the argument to a
T const &. While this is consistent to established behavior, it
introduces weird, invisible things. An alternative would be just to
require the diagnostics: this moves some work on the programmer, but
makes the proposal much more simple, both conceptually and in term of
the implementation.

Martin

Received on 2019-12-19 20:51:53