3 ms·
Yes, I'd seen that white paper, and thought static_if would never happen in C++. Concepts are nice for some things, but as Alexandrescu argues convincingly in
by toth 11y ago
Yes, I'd seen that white paper, and thought static_if would never happen in C++.
Concepts are nice for some things, but as Alexandrescu argues convincingly in the talk omaranto linked, they become quickly become very unwieldy if you need to consider multiple orthogonal concepts at once in the same place. You get a combinatorial explosion of things you need to name. static_if needs to much nicer and smaller code.
The wait paper you link raises some valid concerns, but if it is something you can implement just as a library (as the lightning talk shows) most of them are moot. Note that this library-only version is a somewhat restricted version of static_if, the code in the branches that are not taken is still required to parse, it just is never instantiated.
EDIT: looking again at the whitepaper, they were arguing against a specific proposal for static_if. I think this library-only version does not have the same issues.
Nice discussion here:
http://open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0128r0.html http://open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0128r0....