User-Defined Class Qualifiers in C++23: A New Way to Extend Type Qualifiers
The article discusses a new feature in C++23 called user-defined class qualifiers that allows developers to extend type qualifiers beyond what the language provides natively. Type qualifiers, such as const and volatile, can be seen as a form of subtyping, where const T is a supertype of T. In C++23, explicit object parameters, also known as 'deducing this', provide a concise and effective way to implement user-defined qualifiers for class types. The article provides an example implementation of the 'mut' qualifier, which is the dual/inverse of const. The class X has a regular member function foo and a member function bar, which is only accessible to instances of the form mut