class const_iterator publicconst_iteratorcurrentnullptr const object operatorconst return retrieve)const_iterator operator+current current->nextreturn *thisconst_iterator operator+int const_iterator old *this++*this )return oldbool operator=const const_iterator rhs const return current =rhs currentbool operator!const const_iterator rhs const return !*this =rhs )protectednode *currentobject retrieveconst return current->dataconst_iteratornode * currentp friend class list}figure nested const_iterator class for list class and operator!because those are inherited unchanged we do provide new pair of operator+implementations (because of the changed return typethat hide the originals in the const_iteratorand we provide an accessor/mutator pair for operatorthe accessor operator*shown at lines and simply uses the same implementation as in const_iterator the accessor is explicitly implemented in iterator because otherwise the original implementation is hidden by the newly added mutator version