Nested classes already have access to the containing class's members, assuming they have a pointer/reference to the containing class upon which to operate. Your iterator will need to store a reference to the outer class in order to be able to access the container as you appear to want.
Also note that protected data is usually a code smell and should typically be avoided. Prefer private data and a protected interface if appropriate.
EDIT: Unless this is strictly an exercise to learn how to program a container, just use one of the C++ standard containers such as vector
which are well developed, debugged, and optimized.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…