itemiterator.cpp.html

来自「《Big C++ 》Third Edition电子书和代码全集-Part1」· HTML 代码 · 共 30 行

HTML
30
字号
<html>

<head>
	<title>itemiterator.cpp</title>
</head>

<body>
<pre>  1  #include "itemiterator.h"
  2  
  3  ItemIterator::ItemIterator(vector&lt;Item*&gt;&amp; its)
  4     : items(its)
  5  {
  6     pos = 0;
  7  }
  8  
  9  Item* ItemIterator::get() const
 10  {
 11     if (pos &lt; items.size())
 12        return items[pos];
 13     else
 14        return NULL;
 15  }
 16  
 17  bool ItemIterator::is_done() const
 18  {
 19     return pos &gt;= items.size();
 20  }</pre>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?