Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class Iterator {
  2. Node * current;
  3. public:
  4. Iterator(): current(head) {}
  5. Iterator(const Iterator& it) {
  6. this->current = it.current;
  7. }
  8. ~Iterator();
  9. Iterator& operator=(const Iterator& it) {
  10. current = it.current;
  11. return *this;
  12. }
  13. Iterator& operator++() {
  14. current = current->next;
  15. return *this;
  16. }
  17. T& operator*() const {
  18. return current->data;
  19. }
  20. //DO OGARNIECIAfriend void swap(Iterator& lhs, Iterator& rhs);
  21.  
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement