在C++ 17中,if constexpr介绍了; 然而,似乎没有switch constexpr(见这里).这是为什么?也就是说,如果一个编译器支持if constexpr,它支持它是否也是微不足道的switch constexpr(最坏的情况是if-then-else-if-etc.链,或多个如果带有一些标志来控制直通)?
if constexpr
switch constexpr
c++ c++17 c++20 if-constexpr
c++ ×1
c++17 ×1
c++20 ×1
if-constexpr ×1