4005. "Required behavior" too narrowly defined

Section: 3.46 [defns.required.behavior], [structure.specifications], [res.on.functions] Status: New Submitter: Eric Niebler Opened: 2023-11-03 Last modified: 2023-11-04 15:14:11 UTC

Priority: Not Prioritized

View all issues with New status.


The library's definition of the term "required behavior" (3.46 [defns.required.behavior]) makes it specific to certain replaceable functions such as the replaceable global allocation functions. Notably, it is not one of the elements that are allowed to appear in the descriptions of general function semantics. That is, it isn't in the list in [structure.specifications] p3.

However, the specification of the random number generator library uses "Required behavior" as such a descriptive element of its functions' semantics (e.g., 28.5.6 [rand.predef]).

I think that's a fine use of "Required behavior", so I would like the term to be more generally applicable to the behavior of any stdlib function that may be customized by users. This is relevant for std::execution, where algorithms are customizable but the customizations are required to behave a certain way.


Bullet (2.4) of [res.on.functions] also contradicts to the more narrow definition of 3.46 [defns.required.behavior] by suddenly extending it to "destructor operations".

Proposed resolution: