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

3518. Exception requirements on char trait operations unclear

Section: 27.2.2 [char.traits.require] Status: C++23 Submitter: Zoe Carver Opened: 2021-02-01 Last modified: 2023-11-22

Priority: Not Prioritized

View other active issues in [char.traits.require].

View all other issues in [char.traits.require].

View all issues with C++23 status.

Discussion:

27.2.2 [char.traits.require] p1 says:

X denotes a traits class defining types and functions for the character container type C […] Operations on X shall not throw exceptions.

It should be clarified what "operations on X" means. For example, in this patch, there was some confusion around the exact meaning of "operations on X". If it refers to the expressions specified in [tab:char.traits.req] or if it refers to all member functions of X, this should be worded in some clearer way.

[2021-03-12; Reflector poll]

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

[2021-06-07 Approved at June 2021 virtual plenary. Status changed: Voting → WP.]

Proposed resolution:

This wording is relative to N4878.

  1. Modify 27.2.2 [char.traits.require] as indicated:

    -1- In Table [tab:char.traits.req], X denotes a traits class defining types and functions for the character container type C; […] Operations on X shall not throw exceptionsNo expression which is part of the character traits requirements specified in this subclause 27.2.2 [char.traits.require] shall exit via an exception.