C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Requires-clause for data members

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Thu, 15 Feb 2024 09:52:27 +0000
And what exactly would this do?

-----Original Message-----
Subject: [std-proposals] Requires-clause for data members

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.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-02-15 09:52:30