• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
我是张洪铭我是熊博士
时光静好,与君同;细水长流,与君语
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 5 6 7 8 ··· 47 下一页
2021年9月25日
std::get<C++11多线程库>(07):向线程函数传递参数(4)
摘要: 1 /* 2 * 问-思考: 3 * 1. std::thread 构造函数的第一个参数为重载函数时, 如何决定哪一个重载函数才是我们想要调用的? 4 */ 1 //! [0] * 问-思考-1 * 2 //! std::thread 构造函数的第一个参数为重载函数时, 如何决定哪一个重载函数才是我 阅读全文
posted @ 2021-09-25 18:27 我是张洪铭我是熊博士 阅读(94) 评论(0) 推荐(0)
std::get<C++11多线程库>(07):向线程函数传递参数(2)
摘要: 1 /* 实例场景: 2 * 1. std::thread 构造函数的第一个参数为全局函数时,参数的传递。 3 * 传递方式:std::thread第一个参数为全局函数的函数指针, std::thread 从第二个开始的参数,依次传递给全局函数的参数表 4 * std::thread t(func, 阅读全文
posted @ 2021-09-25 18:20 我是张洪铭我是熊博士 阅读(66) 评论(0) 推荐(0)
std::get<C++11多线程库>(07):向线程函数传递参数(3)
摘要: 1 /* 2 * 实例场景: 3 * 2. std::thread 构造函数的第一个参数为成员函数时,参数的传递。 4 * 传递方式:std::thread第一个参数为成员函数的函数指针, std::thread 从第二个开始的参数,依次传递给成员函数的参数表 5 * Obj obj; 6 * st 阅读全文
posted @ 2021-09-25 18:12 我是张洪铭我是熊博士 阅读(302) 评论(0) 推荐(0)
std::get<C++11多线程库>(07):向线程函数传递参数(1)
摘要: 1 #include <QCoreApplication> 2 #include <iostream> 3 #include <thread> 4 #include <typeinfo> 5 #include <assert.h> 6 7 /* 8 * 话题1: 向线程函数传递参数 9 * 1. 向 阅读全文
posted @ 2021-09-25 18:04 我是张洪铭我是熊博士 阅读(55) 评论(0) 推荐(0)
std::get<C++11多线程库>(05): 右值引用--移动语义--函数模板
摘要: 1 #include <QCoreApplication> 2 #include <iostream> 3 #include <vector> 4 #include <assert.h> 5 6 #define Has_Move 7 /* 8 * 话题:右值引用+移动语义+函数模板 9 * 一、右值 阅读全文
posted @ 2021-09-25 14:51 我是张洪铭我是熊博士 阅读(46) 评论(0) 推荐(0)
std::get<C++11多线程库>(04): join() 调用位置的讨论
摘要: 1 #include <QCoreApplication> 2 #include <iostream> 3 #include <thread> 4 5 6 /* 7 * 话题:join() 如果打算等待对应线程,则需要细心挑选调用join()的位置。 8 * 当在线程运行之后产生异常,在join() 阅读全文
posted @ 2021-09-25 14:49 我是张洪铭我是熊博士 阅读(59) 评论(0) 推荐(0)
std::get<C++11多线程库>(03): 子线程的完整性
摘要: 1 #include <QCoreApplication> 2 #include <iostream> 3 #include <thread> 4 5 /* 6 * 话题:一定要保证新线程结束之前,访问到的数据变量具有有效性。否则会产生未定义的行为和异常。 7 * 单线程代码中,对象销毁之后再去访问 阅读全文
posted @ 2021-09-25 14:48 我是张洪铭我是熊博士 阅读(71) 评论(0) 推荐(0)
std::get<C++11多线程库>(02): 如何启动一个线程
摘要: 1 #include <QCoreApplication> 2 #include <iostream> 3 #include <thread> //管理线程的类和函数 4 5 /* 6 * 话题1: 如何启动 7 * 8 * 在使用C++线程标准库时, 9 * C++如何启动一个线程, 变为了如何构 阅读全文
posted @ 2021-09-25 14:47 我是张洪铭我是熊博士 阅读(279) 评论(0) 推荐(0)
std::get<C++11多线程库>(01): hello C++ 并发世界
摘要: 1 #include <QCoreApplication> 2 #include <iostream> 3 #include <thread> 4 5 //int main(int argc, char *argv[]) 6 //{ 7 // QCoreApplication a(argc, arg 阅读全文
posted @ 2021-09-25 14:44 我是张洪铭我是熊博士 阅读(66) 评论(0) 推荐(0)
2021年9月20日
std::get<C++11多线程库>(06): =delete 删除函数
摘要: 1 #include <QCoreApplication> 2 #include <thread> 3 #include <iostream> 4 5 6 /* 7 * 话题: 删除函数。 8 * 函数使用 =delete 说明符。 全局函数,类成员函数均可使用。 9 * 10 * 1. 通过添加 阅读全文
posted @ 2021-09-20 11:54 我是张洪铭我是熊博士 阅读(407) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 47 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3