C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Proposal regarding labeld breaking and continuation

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 17 Feb 2023 09:50:40 -0500
On Fri, Feb 17, 2023 at 9:50 AM Arthur O'Dwyer via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> On Fri, Feb 17, 2023 at 9:41 AM Hypatia (of) Sva via Std-Proposals <std-proposals_at_[hidden]> wrote:
>>
>>
>> [...] But I appreciate the other idea, is there any new contruct using arrow
>> notation? (the only thing Im aware of are trailing return types and
>> pointed-to structs).
>
>
> C++17 added deduction guides:
> template<class> struct S {};
> S() -> S<int>;
> C++20 added requires-expressions:
> template<class> concept C = true;
> bool b = requires { { 42 } -> C; };
>
> But these are all rightward arrows -> using the existing arrow token; C++ has no token for leftward arrow <- and in fact introducing such a token would break the grammar of
> template<int> struct A {};
> A<-1> a;
>
> HTH,
> Arthur

Also, if labeled break is something we want, we already have a syntax
for labels. So it makes no sense to invent a new one for it.

Received on 2023-02-17 14:51:37