This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
midpoint
should not constrain T
is completeSection: 26.10.16 [numeric.ops.midpoint] Status: C++20 Submitter: Paolo Torres Opened: 2019-04-10 Last modified: 2021-02-25
Priority: 2
View all issues with C++20 status.
Discussion:
The constraint of the midpoint
overload in 26.10.16 [numeric.ops.midpoint]:
template<class T> constexpr T* midpoint(T* a, T* b);-4- Constraints:
T
is a complete object type.
is incorrect. Paragraph 4 states T
is constrained to be a complete object type, however it does not seem to
be possible to implement T
is complete. This means behavior is conditioned dependent on whether a type is
complete, and this seems inconsistent with the library precedent.
[2019-06-12 Priority set to 2 after reflector discussion]
[2020-02 Status to Immediate on Thursday night in Prague.]
Proposed resolution:
This wording is relative to N4810.
Modify 26.10.16 [numeric.ops.midpoint] as indicated:
template<class T> constexpr T* midpoint(T* a, T* b);-4- Constraints:
-?- Mandates:T
is ancompleteobject type.T
is a complete type. […]