C++,boost简单使用1

来源:互联网 发布:php中while循环 编辑:程序博客网 时间:2024/04/29 11:47
#include "stdafx.h"
/*#include<boost/array.hpp>
#include<iostream>
#include<algorithm>
#include<vector>
#include <boost/bind.hpp>
#include <functional>
using namespace boost;
using namespace std;




class add :public std::binary_function<int,int,void>{
public:
void operator()(int i,int j,int k) const{
cout<<(i+j+k)<<endl;
}


};
int _tmainyy(int argc, _TCHAR* argv[])
{
array<int ,5> a={1,2,3,4,5};
a[0]=10;
a.at(3)=90;
auto p=a.data();
for(int i=0;i<a.size();i++){
cout<<a[i]<<ends;
}
cout<<endl;
return 0;
}
int mainwe(){
vector<int> v1;
v1.push_back(0);
v1.push_back(35);
v1.push_back(45);
v1.push_back(65);
v1.push_back(45);
//for_each(v1.begin(),v1.end(),bind1st(add(),10));
for_each(v1.begin(),v1.end(),boost::bind(add(),10,467,_1));
return 0;
}*/
0 0
原创粉丝点击