1.下载Boost Downloads
2.解压,双击bootstrap.bat后出现b2.exe;双击b2.exe后出现bin.v2和stage。
3.配置项目环境。
4.测试,以字符串分割为例。
#include<iostream>
#include<vector>
#include<boost/algorithm/string.hpp>
using namespace std;
int main()
{
string str = "Hello,World,Boost";
vector<string> tokens;
boost::split(tokens, str, boost::is_any_of(","));
for (auto token : tokens) {
cout << token << endl;
}
return 0;
}
输出结果。