I want to write a templatized function in C++ where 4 total items are templatized (T, T2, T3, T4). Two of these appear as parameters in the function (T3 and T4). However, there are two other items that I want to templatize (T and T2) that are present only in the function body, not in the parameter list.
template <typename T, typename T2, typename T3, typename T4>
void foo (T3 edges, T4 distance)
{
...
T xmin;
T2 normal;
...
}
When I try to do this, I get compiler errors for "undefined reference to foo". Any recommendations for how to templatize items that are only present in the function body, not the parameter list?
Note: foo is defined in a cpp file, and then I have specific instantiations also in the cpp file.