3792. __cpp_lib_constexpr_algorithms should also be defined in <utility>

Section: 17.3.2 [version.syn] Status: C++23 Submitter: Marc Mutz Opened: 2022-10-05 Last modified: 2023-11-22 15:47:43 UTC

Priority: Not Prioritized

View other active issues in [version.syn].

View all other issues in [version.syn].

View all issues with C++23 status.


17.3.2 [version.syn] says that __cpp_lib_constexpr_algorithms is only defined in <version> and <algorithm>, but the macro applies to std::exchange() in <utility> as well (via P0202R3), so it should also be available from <utility>.

[2022-10-12; Reflector poll]

Set status to Tentatively Ready after eight votes in favour during reflector poll.

[2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4917.

  1. Modify 17.3.2 [version.syn] as indicated (It is suggested to retroactively apply to C++20):

    #define __cpp_lib_concepts             202207L // also in <concepts>, <compare>
    #define __cpp_lib_constexpr_algorithms 201806L // also in <algorithm>, <utility>
    #define __cpp_lib_constexpr_bitset     202202L // also in <bitset>