Given this code
// In header file
template<typename T>
inline static void my_func(T var)
{
std::cout << var << std::endl;
}
// Used in many cpp files:
void some_function()
{
my_func(1);
my_func("test");
}
I just "upgraded" my free function to a template. It was static and inlined before. But now its a template, I am not 100% if inline and static still apply - my guess is they do... but I am not 100% about the template generation mechanics (i.e. does it copy/paste it into each translation unit?)