3 ms·
>Yes, that's right: All we had to do was replace the var with a const. Beautiful, isn't it? We can write the exact same code and have it run at runtime and comp
by tux3 12y ago
>Yes, that's right: All we had to do was replace the var with a const. Beautiful, isn't it? We can write the exact same code and have it run at runtime and compile time. No template metaprogramming necessary.
Worth pointing out is that modern C++ does this too. Just add a constexpr, no metaprogramming necessary.
Modern C++ really does feel like a new language.