是GCC的
union uint128_t {
uint64_t q[2];
uint64_t w[8];
char b[16];
} __attribute__((aligned (16)));
与(跨平台(相同:
union alignas(16) uint128_t {
uint64_t q[2];
uint64_t w[8];
char b[16];
};
?
是的。 请参阅__attribute__((aligned))
和alignas
。
如果你问"为什么<某些图书馆>使用__attribute__
而不是alignas
? 我怀疑答案是"因为alignas
相对较新,但__attribute__
支持的时间要长得多。某些图书馆>