For some reason I am having trouble with just returning the address of the data field being pointed to by the node pointer.

template <class T>
        T* Iterator<T>::operator->() const
        {
        return *nodePtr->data;
        }

return *nodePtr->data;

Unless data is a pointer to a pointer, this either returns data or throws an indirection error. To get the address of an object you use the & operator:

return &nodePtr->data;
commented: Always get there before others, huh? +4
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.