I'm trying to override an inherited function from a base class which is also a class template, but I can't get it to work.
Up to now the base class is:
template<typename T, typename instrument>
class Probe {
private:
instrument probe;
public:
Probe(instrument _probe) : probe{_probe} {}
virtual T read() const;
instrument getProbe() const {return this->probe;}
};
While the derived class is:
class TestProbe : public Probe<int,int> {
public:
TestProbe(int _probe) : Probe(_probe) {}
virtual int read() const override {return getProbe();} // later will have a more complex expression
};
The error I get whenever I try to compile is: undefined reference to Probe<int, int>::read() const