随笔分类 -  boost

摘要:bind1st bind2nd在stl里面有具体的实现,只是只能绑定两个参数。boost里面的bind使用bind(Fun f,A1 a1,A2,a2...)产生一个对象,这个对象可以有占位符,可以等到调用函数对象的时候传递参数进去即通过bind b(..);b(args);bind绑定参数是通过存储值的形式,如果对象很大,需要耗费很大的代价,可以用ref,但是bind是延后处理的,需要保证所引用的对象在调用之前不被释放。一.绑定普通函数#include #include #include using namespace std;using namespace boost;int f(int 阅读全文
posted @ 2013-08-13 00:44 l851654152 阅读(406) 评论(0) 推荐(0)
摘要:切换到boost目录下面,使用编译命令>bjam.exe --with-date_time --toolset=msvc-9.0 --build-type=complete stage--with只编译某一个库--toolset开发工具stage库所在的目录 阅读全文
posted @ 2013-07-28 00:25 l851654152 阅读(279) 评论(0) 推荐(0)