1 Star 0 Fork 621

edidada/DesignPattern

forked from Micooz/DesignPattern 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
IteratorPattern.cpp 331 Bytes
一键复制 编辑 原始数据 按行查看 历史
Micooz 提交于 2014-10-09 11:46 +08:00 . 加入解释器模式,迭代器模式
#include <iostream>
#include "Aggregate.h"
#include "Iterator.h"
using namespace std;
int main() {
Aggregate* ag = new ConcreteAggreaget();
Iterator *it = new ConcreteIterator(ag, 0);
for (; !(it->IsDone()); it->Next()) {
cout << it->CurrentItem() << endl;
}
delete it;
delete ag;
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/edidada/DesignPattern.git
git@gitee.com:edidada/DesignPattern.git
edidada
DesignPattern
DesignPattern
master

搜索帮助