随笔分类 -  cpp

c++学习
摘要:# 定义全局函数、变量 # 定义全局函数 ## 声明定义在一个头文件 inline 如一些很短的工具函数,创建目录,删除目录之类的 ```cpp #include #include namespace wwc{ void inline CreateDir(std::string path) { st 阅读全文
posted @ 2023-06-03 23:09 shmilyt 阅读(64) 评论(0) 推荐(0) 编辑
摘要:# 环境准备 ## 下载googletest源码 ```cmake https://github.com/google/googletest/releases/tag/release-1.10.0 ``` # 应用到项目 这里只使用googletest功能: CmakeList.txt ```cma 阅读全文
posted @ 2023-05-30 01:28 shmilyt 阅读(433) 评论(0) 推荐(0) 编辑
摘要:多线程并发 总览 创建线程 使用互斥量 异步线程 原子类型 生产者消费者模型 线程池 ‍ 创建线程 #include <iostream> #include <thread> #include <mutex> #include <functional> void task_func(int &n) 阅读全文
posted @ 2023-01-16 01:49 shmilyt 阅读(23) 评论(0) 推荐(0) 编辑
摘要:锁 (161 条消息) C++ 互斥对象 std::mutex 与 std::shared_mutex;互斥锁:std::lock_guard、std::unique_lock 与 std::shared_lock 的应用_持续学习,不断沉淀的博客-CSDN 博客_std::lock_guard s 阅读全文
posted @ 2023-01-07 22:56 shmilyt 阅读(333) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示