Hacker News new | past | comments | ask | show | jobs | submit login

I think Herb Sutter and Bjarne Stroustrup where against it. Its like a glorified ifdef. Its too low level a solution. Concepts solves the same problem in a higher level manner.

Edit:

https://isocpp.org/files/papers/n3613.pdf

"In this paper we consider the impact and risks of adopting static if. Some of the problems addressed by the proposed feature are real and urgent, but on balance this proposal this proposal would do much more harm than good. Language features addressing these problems must not negatively affect the language and our ability to build tools around it. We conclude that future development of static if should be abandoned, and that alternatives such as “concepts-lite” approach should be pursued instead."




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....




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: