I have a base class and 2 inherited classes that inherit from the base class. The base class shouldn't be instantiated so I want to make an abstract base class, but the 2 inherited classes have no shared functions that have the same signature (the signature is similar but not identical), so it doesn't make a whole lot of sense to make a pure virtual function in the base class unless I just make a dummy virtual function and define it in the inherited classes. Is there another approach to this?
Here's an example:
class base {
public:
base() : i{0}, j{0} {}
void compute_i() {
// computes i
}
private:
// declare some variables
double i;
double j;
}
class inherited1 {
public:
inherited1() = default;
void compute_j(double val, double k) {
// compute j here
}
}
class inherited2 {
public:
inherited2() = default;
void compute_j(double val) {
// compute j here
}
}