Can I call a non-member static templated function from a static member function where the definition is split into header and cpp:
// zero.cpp
class Zero
{
static void zero() { one(5); }
};
// one.h
template <typename T>
static void one(T& var);
// one.cpp
template <typename T>
void one(T& var) { }
// main.cpp
...
Zero::zero()
...
I'm having problems getting this to link, I keep getting undefined reference to the function I'm trying to define in one.cpp.
Initially I thought it was due to a problem with namespacing, but all files are now in the same namespace. Am I doing anything fundamentally wrong here?