02-1.cpp
来自「effective stl 源代码 code」· C++ 代码 · 共 28 行
CPP
28 行
//
// Example from ESTL Item 2, without typedefs
//
#include <vector>
#include <iostream>
#include "ESTLUtil.h"
#include "Widget.h"
int main()
{
using namespace std;
using namespace ESTLUtils;
vector<Widget> vw;
Widget bestWidget(3);
for (int j = 0; j < 10; ++j) // insert some Widgets
vw.push_back(Widget(j));
vector<Widget>::iterator i = find(vw.begin(), vw.end(), bestWidget);
cout << "We found the Widget with value: " << *i << endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?