Title
Default template argument for the prototype parameter of a concept
Status
open
Section
13.7.9 [temp.concept]
Submitter
Corentin Jabot

Created on 2026-07-20.00:00:00 last changed 7 days ago

Messages

Date: 2026-09-13.09:55:28

Additional notes (CWG 2026-09-01)

CWG considers this a language design question and requests EWG input via paper issue #2875.

Date: 2026-09-13.09:55:28

Suggested resolution of submitter:

Change in 13.7.9 [temp.concept] as follows:

The first declared template parameter of a concept definition is its prototype parameter. It shall not have a default argument (13.2 [temp.param]). A type concept is a concept whose prototype parameter is a type template parameter.
Date: 2026-07-20.00:00:00

(From submission #951.)

It is design-unclear whether the prototype parameter of a concept definition is allowed to have a default argument. That default argument would be used only in situations where a concept-id appears as a boolean expression. Example:

   template <typename T = int>
   concept C2 = true;
   static_assert(C2<>);

   template<C2 U>      // U is not required to be int
   void f(U);
History
Date User Action Args
2026-09-13 09:55:28adminsetmessages: + msg8682
2026-09-13 09:46:59adminsetmessages: + msg8680
2026-07-20 00:00:00admincreate