How can I declare template function in header file and define in source file?
// foo.h
template<typename T>
bool foo();
// foo.cpp
template<typename T>
bool foo()
{
return false;
}
// main.cpp
bool bar = foo<int>();
I've got this so far. It compiles, but fails at linker: "undefined reference to `bool foo<int>()`"