上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: # 项目属性 ### CMAKE_VERSION ```c++ cmake_minimum_required(VERSION 3.2) if(CMAKE_VERSION VERSION_LESS "3") add_definitions(-std=c++14) else() # add_defini 阅读全文
posted @ 2023-06-19 20:26 小小灰迪 阅读(34) 评论(0) 推荐(0) 编辑
摘要: [912. 排序数组](https://leetcode.cn/problems/sort-an-array/) - 稳定排序:如果 a 原本在 b 前面,且 a == b,排序之后 a 仍然在 b 前面。 - 非稳定排序:如果 a 原本在 b 前面,且 a == b,排序之后 a 不一定在 b 前 阅读全文
posted @ 2023-05-30 21:13 小小灰迪 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 1. member初始化最好在member initialization list中初始化 因为会constructor可能会扩张代码,会产生临时的object对象,然后将它初始化后,以一个assignment运算符将临时对象指定给类member,然后再销毁临时对象 以下情况会导致效率比较低: 初始 阅读全文
posted @ 2023-05-06 15:43 小小灰迪 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 环境配置 sudo apt install libmysqlclient-dev 编译选项 cmake target_link_libraries(main libmysqlclient.so) g++选项 g++ test_mysql.cpp -lmysqlclient -o tets 示例 读取 阅读全文
posted @ 2023-05-04 21:32 小小灰迪 阅读(49) 评论(0) 推荐(1) 编辑
摘要: c++11 // #pragma once #include <iostream> #include <thread> #include <memory> #include <vector> #include <queue> #include <functional> // std:;functio 阅读全文
posted @ 2023-04-26 17:38 小小灰迪 阅读(12) 评论(0) 推荐(0) 编辑
摘要: cppreference解释地址。 模板参数包在模板参数中的顺序要求: 在主类模板中,模板参数包必须是模板参数列表中的最后一个参数。 在函数模板中,模板参数包可能出现在列表的前面,前提是以下所有参数都可以从函数参数中推导出来,或者具有默认参数: template < typename U, type 阅读全文
posted @ 2023-04-26 17:14 小小灰迪 阅读(267) 评论(0) 推荐(0) 编辑
摘要: **Cmake中要将编译版本改成Debug版本** [toc] # linux ## `c_cpp_properties.json`文件 `ctrl+shift+p`弹出搜索框,输入`C++`会显示`C/C++配置UI`,点击后会生成`c_cpp_properties.json`文件 **按需修改` 阅读全文
posted @ 2023-04-21 20:54 小小灰迪 阅读(170) 评论(0) 推荐(0) 编辑
摘要: /** linux v2.4.18 * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded 阅读全文
posted @ 2023-04-21 20:53 小小灰迪 阅读(34) 评论(0) 推荐(0) 编辑
摘要: fork流程图 参考 Linux内核进程创建fork源码解析 关于Linux下fork()函数机制? 阅读全文
posted @ 2023-04-17 18:23 小小灰迪 阅读(22) 评论(0) 推荐(0) 编辑
摘要: SGI STL 二级空间配置器std::alloc过程 SGI STL的std::alloc、glibc的malloc的区别 内存池:内存池可以通过预先分配一定数量的内存块,形成一个内存块池,当需要分配内存时,直接从内存池中取出一个空闲的内存块,并标记为已使用。当不再需要使用某个内存块时,将其标记为 阅读全文
posted @ 2023-04-10 20:09 小小灰迪 阅读(22) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 13 下一页