How I can compile template function with pre-processor condition? Like that (but it is not working):
template void f() { #if (var == tru
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.