[dcl.attr.noreturn]提供以下示例:
[[ noreturn ]] void f() { throw "error"; // OK }
但我不明白有什么意义[[noreturn]],因为函数的返回类型已经存在void.
[[noreturn]]
void
那么,该noreturn属性的重点是什么?它应该如何使用?
noreturn
c++ attributes c++11 noreturn
attributes ×1
c++ ×1
c++11 ×1
noreturn ×1