This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4531. Should there be a feature-test macro update for constexpr std::to_(w)string?

Section: 17.3.2 [version.syn] Status: New Submitter: Jiang An Opened: 2026-02-25 Last modified: 2026-02-28

Priority: Not Prioritized

View other active issues in [version.syn].

View all other issues in [version.syn].

View all issues with New status.

Discussion:

P3391R2 added constexpr to integral overloads of std::to_string and std::to_wstring. However, the paper only added one feature-test macro __cpp_lib_constexpr_format, which doesn't seem clearly related to std::to_(w)string.

Given that P3391R2 contained the constexpr additions in P3438R0 which proposed to bump __cpp_lib_to_string, perhaps we should bump that FTM. It might be also reasonable to bump __cpp_lib_constexpr_string for pure constexpr additions.

Proposed resolution:

This wording is relative to N5032.

[Drafting Note: Two mutually exclusive options are prepared, depicted below by Option A and Option B, respectively.]

Option A:

  1. Modify 17.3.2 [version.syn] as indicated:

    […]
    #define __cpp_lib_to_string                         202306L202511L // also in <string>
    […]
    

Option B:

  1. Modify 17.3.2 [version.syn] as indicated:

    […]
    #define __cpp_lib_constexpr_string                  201907L202511L // also in <string>
    […]