摘要: move语义 memcpy的实现 /*按照4个字节拷贝*/void *memcpy(void *dst, const void *src, size_t num) { assert((dst != NULL) && (src != NULL)); int wordnum = num / 4; int 阅读全文
posted @ 2020-08-27 21:02 Let_Life_Stop 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 转发 https://www.jianshu.com/p/f4cca5ce055a 阅读全文
posted @ 2020-08-04 16:43 Let_Life_Stop 阅读(103) 评论(0) 推荐(0) 编辑
摘要: https://stackoverflow.com/questions/62767072/questions-about-the-c-constructors?noredirect=1#comment110996743_62767072 1 #include <bits/stdc++.h> 2 #i 阅读全文
posted @ 2020-07-07 10:31 Let_Life_Stop 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 首先放一下官网的解释: http://www.lua.org/pil/8.5.html 通常,当一个错误发生的时候,我们想要更多的debug信息当这个错误运行的时候,至少,我们想要一个堆栈信息,展示完整的指向错误的堆栈调用。当pcall返回的时候,它销毁了一部分函数的调用过程。为了解决这个问题,lu 阅读全文
posted @ 2020-06-17 15:25 Let_Life_Stop 阅读(2544) 评论(0) 推荐(0) 编辑
摘要: 返回值 = (表达式1,表达式2,表达式3,,,,,,表达式n) 返回值 = 表达式n的值,类似于一个串联的感觉 相当于一个顺序表达式,看如下的例子 int a, b;b = (a = 5, a * 4), a + 3; 得到的结果: a = 5, b = 20 这里要考虑优先级,当计算完(a = 阅读全文
posted @ 2020-06-16 10:29 Let_Life_Stop 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 配置文件:https://www.bilibili.com/video/BV1Tt411E7W3 殇雪打包好的VSCode[里面附带C++配置文件]https://pan.baidu.com/s/1KLL3vxQ08C2xNMGzqUHRdA提取码zyjm Mingw https://pan.bai 阅读全文
posted @ 2020-05-27 11:17 Let_Life_Stop 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 转载: https://cloud.tencent.com/developer/article/1164997 阅读全文
posted @ 2020-05-16 10:42 Let_Life_Stop 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 460. LFU缓存 有一个疑问,当我的构造函数这个样定义的时候 Node(int _cnt, int _time, int _key, int _value) { cnt = _cnt; time = _time; key = _key; value = _value; } 我这样调用unorde 阅读全文
posted @ 2020-04-20 14:34 Let_Life_Stop 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 不需要开出额外的数组,巧妙地存储答案,值得记录一下。但是注意这个方法只能应用在原数组为0,1的情况下 class Solution { public: int f[2][8] = {{1, -1, 0, 0, 1, -1, 1, -1}, {1, -1, 1, -1, -1, 1, 0, 0}}; 阅读全文
posted @ 2020-04-02 09:24 Let_Life_Stop 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 820. 单词的压缩编码 字典树,将字符串首先按照长度进行排序,然后将字符串倒序插入到字典树中,在插入的时候加一个判断语句, 如果是ch[p][str[i] - 'a'] == 0的话,就代表需要在字典树上插入新的值,所以在这里可以打一个标志位 class Solution { public: in 阅读全文
posted @ 2020-03-28 13:30 Let_Life_Stop 阅读(211) 评论(0) 推荐(0) 编辑