What does "static" mean in the context of declaring global template functions?
- by smf68
I know what static means in the context of declaring global non-template functions (see e.g. What is a "static" function?), which is useful if you write a helper function in a header that is included from several different locations and want to avoid "duplicate definition" errors.
So my question is: What does static mean in the context of declaring global template functions? Please note that I'm specifically asking about global, non-member template functions that do not belong to a class.
In other words, what is the difference between the following two:
template <typename T>
void foo(T t)
{
/* implementation of foo here */
}
template <typename T>
static void bar(T t)
{
/* implementation of bar here */
}