3 ms·
Not really, it had nothing to do with implementation difficulty and the paper actually states that implementing static if would be fairly easy: http://www.open
by Kranar 5y ago
Not really, it had nothing to do with implementation difficulty and the paper actually states that implementing static if would be fairly easy:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3613.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n361...
What the paper says is that static if would make it much harder to perform static analysis of source code, not really because it's hard to implement but because the kind of combinatorial explosion introduced by having non-local bifurcating source code branches to analyze makes analysis incredibly slow.
C++ did eventually adopt if constexpr, which does not have this problem since the branches are always local.
- mhh__ 5y agoif constexpr is the static if we have at home. It's rubbish.