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. Compiler Explorer link: https://lnkd.in/e9betqn4 #cpp #cplusplus #coding #programming #dailybiteofcpp
The compiler should be smart enough to perform this (small) optimization automatically. There is no need to introduce another attribute in an already overly bloated programming language for such a small optimization.
SUKRA HELITEK INC•9K followers
2yWhere would this be useful? Most likely they have plans to use this in future to build more advanced features, but I can't understand how.