3 ms·
So this is basically misusing the compiler as an impractial script interpreter?
by paulhilbert 8y ago
So this is basically misusing the compiler as an impractial script interpreter?
- gpm 8y agoI'm not sure if it counts as misuse, compile time evaluation is intended to be used to do computation at compile time. But "an impractical script interpreter" is certainly one way to view it.
- gnulinux 8y agoIt used to be a misuse (when metaprogramming was templates and then after the very first constexpr functions were introduced) since back then metaprogramming was intended to decide simple facts about the program and make inlining easier. But in this standard they actually made it so that pretty much all C++ stdlib can be constexpr and it is encouraged to "constexpr everything". So while this is not an abuse of C++ compiler, it's likely not a fantastic idea since C++ compilers tend to be slow.
- Koshkin 8y ago> misusing AKA hacking.