I\'d like to provide a library that provides template code. But I would also like to keep the most possible the ownership of this code (generated code) when I can guess the
C++11 solution: use extern templates. Simply add these strings to your main.cpp
file:
extern template void print_me<0>();
extern template void print_me<1>();
Thus you tell compiler not to instantiate print_me
function template in main.cpp
(for template arguments 0 and 1). So linker should search definition of void print_me<0>();
and void print_me<1>();
in other translation units.