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