listsstacksand queues class iterator public const_iterator publiciteratorobject operatorreturn const_iterator::retrieve)const object operatorconst return const_iterator::operator*)iterator operator+this->current this->current->nextreturn *thisiterator operator+int iterator old *this++*this )return oldprotectediteratornode * const_iteratorp friend class list}figure nested iterator class for list class figure shows the constructor and big-five because the zero-parameter constructor and copy constructor must both allocate the header and tail nodeswe provide private init routine init creates an empty list the destructor reclaims the header and tail nodesall the other nodes are reclaimed when the destructor invokes clear similarlythe copy constructor is implemented by invoking public methods rather than attempting low-level pointer manipulations figure illustrates how new node containing is spliced in between node pointed at by and prev the assignment to the node pointers can be described as followsnode *newnode new nodexp->prevp } ->prev->next newnodep->prev newnode/steps and /step /step