Title
"Effects: Equivalent to:" and uninitialized memory algorithms
Status
new
Section
[specialized.algorithms]
Submitter
Jiang An

Created on 2021-10-23.00:00:00 last changed 10 months ago

Messages

Date: 2022-01-15.00:00:00

[ 2022-01-29; Reflector poll ]

Set priority to 3 after reflector poll.
Tim: "P2. Not for this particular case (I'm pretty sure there'll be agreement that this shouldn't induce any constraint), but for the more general issue of "Effects: Equivalent to" propagating Constraints:; I'm not sure that's the right approach in general (unlike the other elements, Constraints: requires special handling beyond "use this code" and is pretty hard to work through if we have a lengthy code block) - and it certainly doesn't really make a lot of sense to propagate Constraints: but not actual core-language constraints."

Date: 2021-10-23.00:00:00

Most uninitialized memory algorithms ([specialized.algorithms]) are specified by plain "Effects: Equivalent to:". According to [structure.specifications]/4, such wording requires propagation of "Constraints" of selected constructors. The first two overloads of std::reduce ([reduce]) are specified similarly.

I feel the wording for uninitialized memory algorithms is incorrect, because it means that the constraints, especially for algorithms in the std, depend on "Constraints" in the specifications of many standard library types (but not any user-defined type), which is implementable but brings serious inconsistency.

Perhaps we should add "Mandates:" to these algorithms (except for algorithms in std::ranges).

History
Date User Action Args
2022-01-29 22:29:35adminsetmessages: + msg12296
2021-10-23 00:00:00admincreate