📄 listiterator.cpp
字号:
// *********************************************************// Implementation file ListIterator.cpp.// *********************************************************#include "ListIterator.h"// Assumes that the line // friend class ListIterator;// has been added to ListNode.hListIterator::ListIterator(const List *aList, ListNode *nodePtr) : container(aList),cur(nodePtr){} //end constructorconst ListItemType & ListIterator::operator*(){ return cur->item;} // end operator*ListIterator ListIterator::operator++(){ cur = cur->next; return *this;} // end prefix operator++bool ListIterator::operator==(const ListIterator& rhs) const{ return ((container==rhs.container) && (cur == rhs.cur));} // end operator ==bool ListIterator::operator!=(const ListIterator& rhs) const{ return !(*this == rhs);} // end operator !=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -