Date: Thu, 19 Nov 2026 20:17:41 +0800
Oops, I originally named the struct "S", then changed it to "X", but forgot
to update the relevant references...
Please treat "S" as "X".
On Thu, Nov 19, 2026, 6:49 PM Sebastian Wittmeier via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> Is S related to X?
>
>
> -----Ursprüngliche Nachricht-----
> *Von:* Cell via Std-Proposals <std-proposals_at_[hidden]>
> *Gesendet:* Do 19.11.2026 10:20
> *Betreff:* [std-proposals] Complete-class contexts for inline static data
> member initializers
> *An:* std-proposals_at_[hidden];
> *CC:* Cell <dicot0721_at_[hidden]>;
>
> Hello,
>
> I would like to discuss whether in-class initializers of inline static
> data members should be considered complete-class contexts.
>
> Currently, [*class.mem.general
> <https://eel.is/c%2B%2Bdraft/class.mem#general-10>*] treats function
> bodies and default member initializers as complete-class contexts, but not
> static data member initializers. This creates some restrictions even though
> C++17 allows inline static data members to be defined and initialized
> within a class.
>
> For example, I would like the following to be well-formed:
>
> struct X { static constexpr std::size_t m_foo = alignof(S);
> static constexpr std::size_t m_bar = bar();
> static inline std::size_t m_baz = m_foo * 2;
> static inline int m_qux = qux();
>
> static consteval std::size_t bar() {
> return sizeof(S) * 2;
> }
> static int qux() {
> return 0;
> }
> };
>
> Ideally, all inline static data member initializers permitted within a
> class definition would be able to use the complete enclosing class, while
> retaining the existing requirements for constant expressions and the
> existing initialization-ordering rules.
>
> Are there fundamental semantic or implementation concerns with such an
> extension?
>
> I would appreciate any thoughts or references to previous discussions.
>
> Thanks.
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
to update the relevant references...
Please treat "S" as "X".
On Thu, Nov 19, 2026, 6:49 PM Sebastian Wittmeier via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> Is S related to X?
>
>
> -----Ursprüngliche Nachricht-----
> *Von:* Cell via Std-Proposals <std-proposals_at_[hidden]>
> *Gesendet:* Do 19.11.2026 10:20
> *Betreff:* [std-proposals] Complete-class contexts for inline static data
> member initializers
> *An:* std-proposals_at_[hidden];
> *CC:* Cell <dicot0721_at_[hidden]>;
>
> Hello,
>
> I would like to discuss whether in-class initializers of inline static
> data members should be considered complete-class contexts.
>
> Currently, [*class.mem.general
> <https://eel.is/c%2B%2Bdraft/class.mem#general-10>*] treats function
> bodies and default member initializers as complete-class contexts, but not
> static data member initializers. This creates some restrictions even though
> C++17 allows inline static data members to be defined and initialized
> within a class.
>
> For example, I would like the following to be well-formed:
>
> struct X { static constexpr std::size_t m_foo = alignof(S);
> static constexpr std::size_t m_bar = bar();
> static inline std::size_t m_baz = m_foo * 2;
> static inline int m_qux = qux();
>
> static consteval std::size_t bar() {
> return sizeof(S) * 2;
> }
> static int qux() {
> return 0;
> }
> };
>
> Ideally, all inline static data member initializers permitted within a
> class definition would be able to use the complete enclosing class, while
> retaining the existing requirements for constant expressions and the
> existing initialization-ordering rules.
>
> Are there fundamental semantic or implementation concerns with such an
> extension?
>
> I would appreciate any thoughts or references to previous discussions.
>
> Thanks.
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>
Received on 2026-11-19 12:17:58
