Simplified I have the following class hierarchy:
class BaseVec {
public:
BaseVec() {};
virtual ~BaseVec() {};
virtual double get_double(int i) con
Why not change foo_templat
e to be:
template
double foo_template(Vec*) {
// use v which involves calling get
return result;
}
and foo
to be:
template
double foo (Vec* v )
{
return foo_template(v)
}
and let argument deduction do the work?
(You can probably get rid of one of the functions, but I wanted to keep is as close to the original)