C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow using type alias in requires-clause

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Sun, 21 Jun 2026 07:06:15 +0200
On 6/21/26 06:32, Hewill Kang wrote:
>
> Jens Maurer <jens.maurer_at_[hidden] <mailto:jens.maurer_at_[hidden]>> 於 2026年6月21日週日 上午2:55寫道:
>
>
>
> On 6/20/26 11:32, Hewill Kang via Std-Proposals wrote:
> > Hi all,
> >
> > After three years, I finally had the opportunity to finish this paper, and I am grateful for any feedback:
> >
> > https://isocpp.org/files/papers/D4281R0.html <https://isocpp.org/files/papers/D4281R0.html> <https://isocpp.org/files/papers/D4281R0.html <https://isocpp.org/files/papers/D4281R0.html>>
>
> I don't follow the second one of the two reasons given for requiring
> "typename": "Second, it ensures parser simplification."
>
> If we can get away without typename for alias-declarations, we sure can
> get away without typename in requires-expressions, too. Do you have actual
> compiler implementation experience to the contrary?
>
>
> The description here is indeed somewhat vague.
> My initial idea was that always requiring typename could be more implementation-friendly, since it just adds `using identifier =` to the original /type-requirement/, essentially:
>
> /{using identifier =}_opt //type-requirement
> /
> while supporting optional typename might introduce unnecessary complexity for implementation.

Have you implemented this? Have you discussed this with implementers?

> Is this reasonable?

In the absence of actual evidence to the contrary, no.

Jens

Received on 2026-06-21 05:06:20