会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xilu-H
博客园
首页
新随笔
联系
订阅
管理
2023年8月3日
Pecan 框架学习笔记
摘要: Pecan 是一个 WSGI(Web Server Gateway Interface) 对象调度 web 框架,具有架构设计精妙、响应快速,依赖较少的特点。在 OpenStack API 框架中使用较多。 一、Pecan 工程的创建和运行 1. 安装 Pecan 使用 pip 安装 pecan:
阅读全文
posted @ 2023-08-03 23:32 OXYGEN1
阅读(154)
评论(0)
推荐(0)
2023年1月5日
【智能指针】使用std::shared_ptr时,避免循环引用
摘要: 循环引用会导致内存泄漏。看如下代码: #include <iostream> #include <memory> using namespace std; class CA; class CB; class CA { public: shared_ptr<CB> m_pb; ~CA() { cout
阅读全文
posted @ 2023-01-05 23:06 OXYGEN1
阅读(16)
评论(0)
推荐(0)
const char * 、char const *与char * const三者的区别
摘要: 1. const char *p; 表示p指向的内容不能通过p来修改(p所指向的目标,那个目标中的内容不能通过p来修改)。因此,有人把p称为“常量指针”。 2. char const *p; “char const *p;”等价于“const char *p;”。 3. char * const p
阅读全文
posted @ 2023-01-05 12:40 OXYGEN1
阅读(27)
评论(0)
推荐(0)
2022年12月30日
常见数据结构操作的复杂度
摘要:
阅读全文
posted @ 2022-12-30 22:21 OXYGEN1
阅读(12)
评论(0)
推荐(0)
2022年9月28日
myMemmove
摘要: void *myMemmove(void *dest, const void *src, size_t n) { char *p1 = (char *)dest; const char *p2 = (char *)src; if (p2 < p1) { p2 += n; p1 += n; while
阅读全文
posted @ 2022-09-28 15:51 OXYGEN1
阅读(9)
评论(0)
推荐(0)
2022年7月26日
char c= 256
摘要: int main() { char c= 256; int a= c; printf("%d\n",a + 1); return 0; } char 类型1字节(BYTE),8位(bit),c=256的二进制表示为100000000,char保留低8位,即为0,所以a=0,最终输出为1
阅读全文
posted @ 2022-07-26 18:24 OXYGEN1
阅读(100)
评论(0)
推荐(0)
2022年7月8日
map unordered_map
摘要: map底层是红黑树,元素自动排序,在红黑树上做查找、插入、删除操作的时间复杂度为O(logN)。 map适用于数据需要自动排序 自己写的类放进map需要重载小于号,因为红黑色需要知道谁大谁小,然后排序。(不然编译报错) unorded_map底层是散列表(哈希表),在不成长的时候,搜索、插入、删除时
阅读全文
posted @ 2022-07-08 18:10 OXYGEN1
阅读(16)
评论(0)
推荐(0)
2022年6月27日
原码、反码、补码与位运算
摘要: https://mp.weixin.qq.com/s/yJeZdSLnYBiOFRVdndmNwg https://zhuanlan.zhihu.com/p/338227166 https://www.runoob.com/w3cnote/bit-operation.html
阅读全文
posted @ 2022-06-27 19:44 OXYGEN1
阅读(30)
评论(0)
推荐(0)
2022年6月11日
【智能指针】两个unique_ptr互指会有什么问题?
摘要: 两个独占式智能指针unique_ptr互指会有什么问题?看如下代码: #include <iostream> #include <memory> using namespace std; class B; class A { public: unique_ptr<B> pb_; ~A() { cou
阅读全文
posted @ 2022-06-11 16:22 OXYGEN1
阅读(38)
评论(0)
推荐(0)
2022年6月9日
epoll
摘要: https://zhuanlan.zhihu.com/p/64138532 https://my.oschina.net/alchemystar/blog/3008840
阅读全文
posted @ 2022-06-09 10:16 OXYGEN1
阅读(43)
评论(0)
推荐(0)
下一页
公告