Daily bit(e) of C++ | [[no_unique_address]]
Daily bit(e) of C++ ♻️129, Avoiding the overhead of empty generic type members using the C++20 [[no_unique_address]].
When storing a generic type as a member, the member will always take up at least 1 byte (plus padding), even when the concrete type is empty.
C++20 introduced the [[no_unique_address]] attribute. Non-static data members annotated with this attribute are permitted to overlap with other members or base classes.