This might be a trivial question. Have below code,
class message {
public:
virtual void setMessage(const string& name, const int& age, const string& title) const;
virtual void getMessage(const string& name) const;
private:
void removeMessage(const string& name);
};
class test : public message {
public:
using message::removeMessage;
};
int main()
{
test t;
t.removeMessage("_");
while (1);
return 0;
}
Trying to expose removeMessage() as a public method from the test class. But this is giving error that,
error C2876: 'message': not all overloads are accessible
How to expose a private method in base class as public in derived class?