What am I missing? Why won't the compiler realize that I'm calling the base class version of getTemperature() with no parameters? Tried on godbolt, gcc and clang don't find it. Hmmph. (It's that getTemperature() call inside sayTemperature(...) btw)
#include <string>
struct Person
{
virtual double getTemperature(int day) {return (day & 1) ? 98.5 : 98.6;}
double getTemperature() {return 98.7;}
};
struct Patient : public Person
{
double getTemperature(int day) {return 98.8; }
std::string sayTemperature() {return "Patient's temperature is " + std::to_string(getTemperature());}
};