If the base class has both const and non-const version of a function, can I refer to only one or the other in the derived class by the using keyword?
struct Base
{
protected:
int x = 1;
const int& getX() const {return x;}
int& getX() {return x;}
};
struct Derived : public Base
{
public:
using Base::getX; // Can we refer to the const or the non-const only?
};
If no, whats the simplest way to make const getX() public in Derived without repeating the function body?