Hacker News new | ask | show | jobs
by greesil 2716 days ago
I think I just got used to C++11. What is this dark magic?
2 comments

If you refer to `if constexpr`: There is no dark magic. Most of it is already possible with C++11 meta programming (i.e. with std::enable_if [0]). However, it's much more readable now (and it's more fun to write :D). I think we're on a good way that compile time programming will be more easily accessible.

[0] https://en.cppreference.com/w/cpp/types/enable_if

Most of this stuff was possible in C++03. Newer standards only make it more convenient and (arguably) saner.