Jay*_*esh 2 c++ gcc structure c++17
以下结构化绑定代码在clang上运行良好.现场演示
但是,它在GCC编译器上失败了.现场演示
#include <iostream>
struct st {
bool b = true;
};
template <class T>
bool func() noexcept {
auto [a] = T{};
return a;
}
int main() {
const bool b1 = func<st>();
}
Run Code Online (Sandbox Code Playgroud)
为什么结构化绑定在GCC上失败?
| 归档时间: |
|
| 查看次数: |
463 次 |
| 最近记录: |