I'm trying to hook an existing namespace onto std functionality by "using" some specific std math functions. The problem is that for coverage reasons i'd like to explicitly instantiate the template functions before i actually use them anywhere. Afterwards i want to write some unit tests that verify the functionality.
Example
namespace foo {
using std::sin;
// ...
}
This works fine, such that i can write
foo::sin(0);
but, the explicit template instantiation doesn't work
template double foo::sin<int>(int); // doesn't work (this is what i want)
If i instantiate std::sin directly, it works.
template double std::sin<int>(int); // works
Can this this kind of reusing of namespace functionality be achieved for explicit template instantiations?
Edit
Someone marked this question as answered here, but this post seems to have a different problem. I do NOT want to define a specialization of a function template (std namespace to my own that is). Rather, i want my namespace to "imitate" the std namespace for some math functions.
Edit 2
I'm using clang 9 which throws an error. GCC happily compiles the code. (see comments below)