C++ Logo

std-proposals

Advanced search

[std-proposals] Requires-clause for data members

From: Jan Schultke <janschultke_at_[hidden]>
Date: Thu, 15 Feb 2024 10:31:12 +0100
Has there been any discussion of requires-clauses for data members?
Something like:

> template<int N>
> struct numbers {
> int x requires (N >= 1) = 0; // leading
> int y requires (N >= 2) = 0; // trailing
> };

It seems grammatically possible if you mandate parentheses, and it
would certainly help people reduce the use of partial specializations
in these places.

Received on 2024-02-15 09:31:25