Created on 2018-12-11.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4910.
Change [namespace.std] as indicated:
-2- Unless explicitly prohibited, a program may add a template specialization for any standard library class template to namespace std provided that (a) the added declaration depends on at least one program-defined type and (b) the specialization meets the standard library requirements for the original template.(footnote 163)
-3- The behavior of a C++ program is undefined if it declares an explicit or partial specialization of any standard library variable template, except where explicitly permitted by the specification of that variable template.
[Note 1: The requirements on an explicit or partial specialization are stated by each variable template that grants such permission. — end note]
[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP. ]
[ 2022-09-28; Reflector poll ]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
[ 2022-08-25; Jonathan Wakely provides improved wording ]
[ 2022-08-24; LWG telecon ]
Each variable template that grants permission to specialize already
states requirements more precisely than proposed here anyway.
For example, disable_sized_range
only allows it for
cv-unqualified program-defined types.
Adding less precise wording here wouldn't be an improvement.
Add a note to make it clear we didn't just forget to say something here,
and to remind us to state requirements for each variable template in future.
[ 2018-12-21 Reflector prioritization ]
Set Priority to 3
Previous resolution [SUPERSEDED]:
This wording is relative to N4791.
Change [namespace.std] as indicated:
-2- Unless explicitly prohibited, a program may add a template specialization for any standard library class template to namespace std provided that (a) the added declaration depends on at least one program-defined type and (b) the specialization meets the standard library requirements for the original template.(footnote 174)
-3- The behavior of a C++ program is undefined if it declares an explicit or partial specialization of any standard library variable template, except where explicitly permitted by the specification of that variable template, provided that the added declaration depends on at least one program-defined type.
The permission denoted by [namespace.std]/3 should be limited to program-defined types.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-11-17 00:42:33 | admin | set | messages: + msg13044 |
2022-11-17 00:42:33 | admin | set | status: voting -> wp |
2022-11-08 03:46:49 | admin | set | status: ready -> voting |
2022-09-29 18:22:01 | admin | set | messages: + msg12834 |
2022-09-29 18:22:01 | admin | set | status: open -> ready |
2022-08-25 19:38:47 | admin | set | messages: + msg12718 |
2022-08-25 19:38:47 | admin | set | messages: + msg12717 |
2022-08-25 19:38:47 | admin | set | status: new -> open |
2018-12-21 15:26:00 | admin | set | messages: + msg10266 |
2018-12-16 12:00:40 | admin | set | messages: + msg10260 |
2018-12-11 00:00:00 | admin | create |