Iterator not accessible because of private inheritance

Posted by Bo Tian on Stack Overflow See other posts from Stack Overflow or by Bo Tian
Published on 2012-09-21T15:27:35Z Indexed on 2012/09/21 15:37 UTC
Read the original article Hit count: 217

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about c++

Related posts about stl