C++ sizeof wrapper class

前端 未结 3 2045
梦如初夏
梦如初夏 2021-01-17 23:23

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)

3条回答
提交回复
热议问题