( 原书第四章,General Concepts)html
只介绍新内容,关于头文件格式和后缀等C++03已经规范化的内容,再也不赘述。数据库
void func(int x, int y); auto l = [](int x, int y){...}; class C { public: void operator()(int x, int y); void memfunc(int x, int y); } int main() { C c; std::shared_ptr<C> sp(new C); std::bind(func, 3, 7)(); // 注意(); func(3, 7) std::bind(C(), 3, 7)(); // C()(3, 7); std::bind(l, 3, 7)(); //l(3, 7); std::bind(&C::memfunc, c, 3, 7)(); // c.memfunc(3, 7); std::bind(&C::memfunc, sp, 3, 7)(); // sp->memfunc(3, 7); //async 表示后台线程执行 std::async(func, 3, 7); // 注意(); func(3, 7) std::async(c, 3, 7); // c.operator()(3, 7); std::async(l, 3, 7); //l(3, 7); std::async(&C::memfunc, &c, 3, 7)(); // c.memfunc(3, 7); std::async(&C::memfunc, sp, 3, 7)(); // sp->memfunc(3, 7); }