【发布时间】:2011-02-02 00:52:18
【问题描述】:
我有一个关于 C/C++ 对齐的问题。在 Determining the alignment of C/C++ structures in relation to its membersMichael Burr 发布了这个宏:
#define TYPE_ALIGNMENT( t ) offsetof( struct { char x; t test; }, test )
在 cmets 中,有人写过这可能会因非 POD 类型而失败。有人可以给我一个失败的代码示例吗?
【问题讨论】:
标签: c++ c memory-management alignment