⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 50-2.cpp

📁 effective stl 源代码 code
💻 CPP
字号:
//
// Another example from ESTL Item 50
//

#include <string>
#include <iostream>
#include <vector>
#include "ESTLUtil.h"

int transmogrify(int x);				// this function produces
										// some new value from x

int transmogrify(int x)
{
	return x + 10;
}


int main()
{
	using namespace std;
	using namespace ESTLUtils;

	vector<int> values;

	values.push_back(1);
	values.push_back(10);
	values.push_back(100);
	values.push_back(37);
	

	vector<int> results;
	transform(values.begin(), values.end(), 	// this will attempt to
				results.end(),					// write beyond the 
				transmogrify);					// end of results!

	return 0;
}

⌨️ 快捷键说明

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