9
You can't. The preprocessor, as this names indicates, processes the source file before the compiler. It has therefore no knowledge of the values of your template arguments.
If you need to generate different code paths with template parameter, you can just simply use if or other C++ statement:
template <bool var>
void f()
{
if (var == true) {
// ...
}
}
Compiler can optimize it and generate code that doesn't contain such branches.
A little drawback is that some compiler (e.g. Msvc) will generate warnings for conditions which is always constant.