编译时常 问答列表

结构的编译时大小减去填充

作者:bhillam 提问时间:6/2/2020

我正在尝试使用 Boost MPL 和 Fusion 来计算不包括任何填充的结构的大小。这是我目前最好的尝试: 现场示例 template<class T> constexpr std::size...

在 GCC 中编译,但不在 Clang 中编译:“initializer 元素不是编译时常量”

作者:rammmmm_ 提问时间:11/14/2023

当我使用编译器 clang-15 (15.0.7) 时,我遇到了这个错误(在标题中)。以下是最低限度的可重现代码: #include <stdio.h> #include <stdint.h> #...


共2条 当前第1页