I'm trying to generate accurate code coverage for my templated math classes. I'm default instantiating every method inside a template class with a trick from here
template class Vector2D<float>;
so that the coverage is not always 100% but shows me, where functions were never called. The problem is that if i go further and use type traits to enable member functions of templated classes only for certain types, the coverage for these is again always at 100%. Both gcov and llvm-cov show that these functions are not generated. I'm guessing it's because these function are their own "templates" within my templated class?
template<typename T>
class Vector2D {
...
template <class U = T>
typename std::enable_if<std::is_floating_point<U>::value, void>::type rotate(
T angle) {
...
}
};
How can i (default) instantiate these functions such that the coverage report will show them in orange/red if they are never called?