Closed otrempe closed 1 year ago
The workaround is to redeclare the base class function in the derived class
That's how C++ works, it isn't an issue with the library.
You don't need to redeclare the function, you can also "import" it.
class IDerived : public IBase
{
public:
using IBase::MyOverloadedFunction;
using IBase::MyConstOverloadedFunction;
virtual void MyOverloadedFunction( double ) = 0;
virtual void MyConstOverloadedFunction( double ) const = 0;
};
Non virtual function should hide base class function, but virtual function should be fine. This scheme compiles fine on all compiler versions I tried without importing base class functions.
The function being virtual or not change nothing, it's the same rules.
As you can see : https://godbolt.org/z/6f4h4nPMW
You're right, I was fooled by my test using the wrong type for calling the overloaded function.