C++20 introduced the [[no_unique_address]] attribute that can be used to annotate non-static data members.
The attribute allows the compiler to optimize empty members marked with this attribute to take up no space.
Click to open in Compiler Explorer.
Leave a comment