Title
`member_offset::total_bits` should be `noexcept`
Status
new
Section
[meta.reflection.layout]
Submitter
Hewill Kang

Created on 2026-03-10.00:00:00 last changed 1 week ago

Messages

Date: 2026-04-13.15:10:35

Proposed resolution:

This wording is relative to N5032.

  1. Modify [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`.

Date: 2026-04-15.00:00:00

[ 2026-04-13; Reflector poll. ]

Set priority to 3 after reflector poll.

"The calculation can overflow `ptrdiff_t` which would be undefined, so there's an implicit narrow contract."

Date: 2026-03-10.00:00:00

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

History
Date User Action Args
2026-04-13 15:10:35adminsetmessages: + msg16269
2026-03-13 10:36:10adminsetmessages: + msg16019
2026-03-10 00:00:00admincreate