3628. "Effects: Equivalent to:" and uninitialized memory algorithms

Section: 26.11 [specialized.algorithms] Status: New Submitter: Jiang An Opened: 2021-10-23 Last modified: 2022-01-29

Priority: 3

View other active issues in [specialized.algorithms].

View all other issues in [specialized.algorithms].

View all issues with New status.

Discussion:

Most uninitialized memory algorithms (26.11 [specialized.algorithms]) are specified by plain "Effects: Equivalent to:". According to 16.3.2.4 [structure.specifications]/4, such wording requires propagation of "Constraints" of selected constructors. The first two overloads of std::reduce (26.10.4 [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).

[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."

Proposed resolution: