Consider this code:
// T is *any* type
struct str_T{
T a, b;
};
I know that there's (almost always) padding between objects with different alignments because both members are of type T
. But this time there's no different alignments. Can this assertion always pass?
static_assert(sizeof(str_T) == 2 * sizeof(T));
// i.e. padding-free