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?
You have to promote this iterator class.
Use using keyword in public section.
class B : private std::deque<A>
{ ...
public:
using std::deque<A>::iterator;
};
The same for other types as well as other functions from implementation base class(es).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With