Iterator not accessible because of private inheritance
- by Bo Tian
I've created a new class that composes std::deque by private inheritance, i.e,
class B : private std::deque<A>
{ ... };
and in my source code I tried to use iterator of B, i.e.,
B::iterator it
The compiler error is
error C2247: 'std::deque<_Ty>::iterator' not accessible because 'B' uses 'private' to inherit from 'std::deque<_Ty>'
So the question is, how can I make the iterator accessible?