![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
cube_keybox
这个作者很懒,什么都没留下…
展开
-
C++ 容器 线程安全包装
容器 线程安全包装 实现对容器使用线程锁的包装模板类,省去重复 写各种简单的容器线程包装 一些前置工具来自于 https://gitee.com/keybox/actor-library/blob/master/actor/commons/commons_utils.h 互斥锁包装模板 template <typename T,typename Lock = std::mutex> class LContainer{ // struct Lock{ //要求原创 2021-08-27 18:04:17 · 522 阅读 · 0 评论 -
C++ 实现 Go defer
模仿 Go defer 的C++实现 简单实现 在类中存储函数指针,在析构函数中调用这个函数即可 // 不可靠基类 //继承这个类的类将无法拷贝 struct noncopy{ protected: noncopy() = default ; //保证空构造存在 noncopy(const noncopy&) = delete ; //删除拷贝函数 noncopy& operator=(const noncopy&) = delete ; //删除等于拷贝原创 2021-08-27 18:03:55 · 97 阅读 · 0 评论