Date: Wed, 15 Jul 2026 08:14:12 +0200
Perhaps with metaprogramming you could get this feature.
Let's assume you can define custom groupings or sections or annotations for a group.
Some company coding guidelines could then standardize sections and put in rules how different functions and members are handled and apply further checks.
E.g. allow a non-explicit single argument constructor only within a certain group or with a certain annotation.
-----Ursprüngliche Nachricht-----
Von:Walt Karas via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Mi 15.07.2026 05:07
Betreff:[std-proposals] Allow const / static / noexcept / virtual / override after member access specifier
An:std-proposals_at_[hidden];
CC:Walt Karas <wkaras_at_[hidden]>;
Allow const and/or static and/or noexcept and/or virtual and/or override between a member access specifier and the colon. This will affect members to which access is determined by the access specifier.
If const appears, affected member variables will be const, and affected member references will be references to const. For non-static affected member function, the this pointer will be a pointer of a const object. There must be no affected member function for which the this pointer cannot be a pointer to const.
If static appears, affected members will be static. There must be no affected member function that is not permitted to be static. If static appears, neither virtual nor override may appear after the same member access specifier.
If noexcept appears, affected member functions will be noexcept.
If virtual appears, non-static affected member functions will be virtual, except for constructors.
If override appears, non-static affected member functions are virtual and must override virtual functions in base classes.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2026-07-15 06:18:51
