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.

4538. member_offset::total_bits should be noexcept

Section: 21.4.11 [meta.reflection.layout] Status: New Submitter: Hewill Kang Opened: 2026-03-10 Last modified: 2026-03-13

Priority: Not Prioritized

View all other issues in [meta.reflection.layout].

View all issues with New status.

Discussion:

This member simply returns the result of integer calculations, which can be noexcept.

Proposed resolution:

This wording is relative to N5032.

  1. Modify 21.4.11 [meta.reflection.layout] as indicated:

    struct member_offset {
      ptrdiff_t bytes;
      ptrdiff_t bits;
      constexpr ptrdiff_t total_bits() const noexcept;
      auto operator<=>(const member_offset&) const = default;
    };
    
    constexpr ptrdiff_t member_offset::total_bits() const noexcept;
    

    -1- Returns: bytes * CHAR_BIT + bits.