If I have a struct like this:
struct S {
ANY_TYPE a;
ANY_TYPE b;
ANY_TYPE c;
} s;
Can I safely assume that the following assump
This changes in C++20 (at least the current draft): if you annotate a
, b
, and c
with [[no_unique_address]]
and they happen to be empty structures it's possible that they will all have the same address.
In fact it's more complex - if any two are empty and annotated with that then all 3 can share an address.