C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Make inline implicit for static data members with in-class initialiser

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Thu, 18 Jan 2024 16:36:05 +0100
Would the linker be able to detect, if some translation units use "static type s_member = ...;" and some translation units have the static member variable defined as "static type s_member;" for primitive and class types? Would the correct constructor be called? Would it work without ABI break, even if one of the translation units was compiled with an old compiler? Even for dynamic libraries?   -----Ursprüngliche Nachricht----- Von:ஜெய்கணேஷ் குமரன் via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Do 18.01.2024 15:08 Betreff:[std-proposals] Make inline implicit for static data members with in-class initialiser An:std-proposals_at_[hidden]; CC:ஜெய்கணேஷ் குமரன் <jaiganesh.kumaran_at_[hidden]>; Hello all, Currently, in C++ you must put the inline keyword on to have a static data member with an in-class initialiser. I reälly find this unnecessary, as it is obvious that the data member needs to be inline to have an in-class initialiser. Current: inline static type s_member = ...; Proposed: static type s_member = ...; Note: I do not have the time to participate in standardisation in order to open formal proposals, but I wish someöne else does based on my ideas. Thanks, Jaiganésh Kumaran. -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-01-18 15:36:12