摘要: 参考: https://blog.csdn.net/weixin_43297891/article/details/137241935 https://ruanyifeng.com/blog/2017/09/flame-graph.html https://hqber.com/archives/48 阅读全文
posted @ 2024-04-22 16:55 白伟碧一些小心得 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 基本概念: 2. jsoncpp 的使用jsoncpp库中的类被定义到了一个Json命名空间中,建议在使用这个库的时候先声明这个命名空间: using namespace Json;使用jsoncpp库解析json格式的数据,我们只需要掌握三个类: Value 类:将json支持的数据类型进行了包装 阅读全文
posted @ 2024-04-15 11:04 白伟碧一些小心得 阅读(11) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/qq_41317716/article/details/125839126 阅读全文
posted @ 2024-03-19 17:45 白伟碧一些小心得 阅读(1) 评论(0) 推荐(0) 编辑
摘要: thread_local变量 thread_local变量是C++ 11新引入的一种存储类型。它会影响变量的存储周期(Storage duration),C++中有4种存储周期: automatic static dynamic thread 有且只有thread_local关键字修饰的变量具有线程 阅读全文
posted @ 2024-02-21 17:17 白伟碧一些小心得 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 无锁栈: #pragma once template<typename T> class ref_count_stack { private: //前置声明节点类型 struct count_node; struct counted_node_ptr { //1 外部引用计数 int externa 阅读全文
posted @ 2024-01-30 10:42 白伟碧一些小心得 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 一、查询linux命令手册: #include<unistd.h> #include<getopt.h> /*所在头文件 */ int getopt(intargc, char * const argv[], const char *optstring); int getopt_long(int a 阅读全文
posted @ 2024-01-22 11:15 白伟碧一些小心得 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 关于迭代器失效,,今天做一个总结。 迭代器失效分三种情况考虑,也是三种数据结构考虑,分别为数组型,链表型,树型数据结构。 1、对于序列式容器,比如vector,删除当前的iterator会使后面所有元素的iterator都失效。 举例如下: void vectorTest() { vector<in 阅读全文
posted @ 2023-12-13 11:59 白伟碧一些小心得 阅读(22) 评论(0) 推荐(0) 编辑
摘要: c++11通常单例模式如下: template <typename T> class Singleton { protected: Singleton() = default; Singleton(const Singleton<T>&) = delete; Singleton& operator= 阅读全文
posted @ 2023-09-25 11:55 白伟碧一些小心得 阅读(12) 评论(0) 推荐(0) 编辑
摘要: std::mutex #include <mutex> #include <list> std::mutex some_mutex; std::list<int> mylist; void func(int value) { some_mutex.lock(); // 加锁 mylist.push_ 阅读全文
posted @ 2023-09-21 11:22 白伟碧一些小心得 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 1.概述 spdlog github地址,spdlog日志库自身带有包括控制台日志记录、基础文件日志记录、循环文件日志记录、每日文件日志记录等在内的日志记录方式,能满足日常不同的情景需求。 本文主要介绍spdlog日志库的基本使用,包括创建日志记录器(logger)、创建日志记录器槽(sink)、设 阅读全文
posted @ 2023-09-11 14:40 白伟碧一些小心得 阅读(176) 评论(0) 推荐(0) 编辑