安装:
sudo apt-get install libboost-dev libboost-doc
卸载:
sudo apt-get --purge remove libboost-dev libboost-doc
测试:
- #include<iostream>
- #include<boost/bind.hpp>
- using namespace std;
- using namespace boost;
- int fun(int x,int y){return x+y;}
- int main(){
- int m=1;int n=2;
- cout<<boost::bind(fun,_1,_2)(m,n)<<endl;
- return 0;
- }
编译:
g++ test.cpp -o test