Suppose I have a class A that does not inherit from anything, has no virtual methods, and has exactly one variable of type T. Does C++ guarantee sizeof(A) == sizeof(T)
sizeof(A) == sizeof(T)
No, it might be more than sizeof(T) due to padding.
sizeof(T)