Simplify Code with if constexpr and Concepts in C++17/C++20
Before C++17, we had a few quite ugly-looking ways to write static if (if that works at compile time). For example, you could use tag dispatching or SFINAE. Fortunately, that’s changed, and we can now benefit from if constexpr and concepts from C++20!
Let’s see how we can use it and replace some std::enable_if code.
C++ Stories