Title
midpoint should not constrain T is complete
Status
c++20
Section
[numeric.ops.midpoint]
Submitter
Paolo Torres

Created on 2019-04-10.00:00:00 last changed 46 months ago

Messages

Date: 2020-02-14.11:00:18

Proposed resolution:

This wording is relative to N4810.

  1. Modify [numeric.ops.midpoint] as indicated:

    template<class T>
      constexpr T* midpoint(T* a, T* b);
    

    -4- Constraints: T is an complete object type.

    -?- Mandates: T is a complete type.

    […]

Date: 2020-02-14.11:00:18

[ 2020-02 Status to Immediate on Thursday night in Prague. ]

Date: 2019-06-12.00:00:00

[ 2019-06-12 Priority set to 2 after reflector discussion ]

Date: 2019-04-10.00:00:00

The constraint of the midpoint overload in [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.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-14 11:00:18adminsetmessages: + msg11112
2020-02-14 11:00:18adminsetstatus: new -> immediate
2019-06-10 05:16:56adminsetmessages: + msg10432
2019-04-13 16:42:43adminsetmessages: + msg10391
2019-04-10 00:00:00admincreate