C++ Template Metaprogramming – Is it possible to output the generated code?
Nope, in general, it can’t be done. Templates are simply part of the C++ language, they’re not a separate preprocessor, so they don’t generate C++ code. The usual solution is to sprinkle your code with static asserts and other tests to verify that the right templates get instantiated in the right ways. Once you start … Read more