C++ Logo

std-proposals

Advanced search

[std-proposals] Allow const / static / noexcept / virtual / override after member access specifier

From: Walt Karas <wkaras_at_[hidden]>
Date: Wed, 15 Jul 2026 03:02:01 +0000 (UTC)
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.

Received on 2026-07-15 03:06:56