So, a simpler example would be:
Code:
#include <list>
class IntList: private std::list<int>
{
public:
void push_back(int);
private:
using std::list<int>::push_back;
};
int main()
{
IntList li;
li.push_back(10);
}
I suppose the problem is that li.push_back(10) matches both push_back methods, even though one is private.
Why would you use the using statement in the first place? How are you going to use push_back in your class, where both are accessible?
-------
In any case, you have two overloads because the signatures are not identical (STL passes things by const reference), but that difference is not enough to disambiguate the call.
If you make push_back take a const reference, it appears it would completely hide the parent's push_back method, so the using statement doesn't help anyway.
Code:
#include <iostream>
#include <list>
class IntList: private std::list<int>
{
public:
void push_back(const int& i) {
std::cout << "Pushing " << i << '\n';
std::list<int>::push_back(i); //still got to spell it out fully, or it'll go into recursion
}
private:
using std::list<int>::push_back; //useless
};
int main()
{
IntList li;
li.push_back(10);
}