上一页 1 ··· 4 5 6 7 8 9 10 下一页

2021年6月25日

Qt 栈中对象树结构问题

摘要: Qt 引入对象树的概念,在一定程度上解决了内存问题。 当一个QObject对象在堆上创建的时候,Qt 会同时为其创建一个对象树。不过,对象树中对象的顺序是没有定义的。这意味着,销毁这些对象的顺序也是未定义的。Qt 保证的是,任何对象树中的 QObject对象 delete 的时候,如果这个对象有 p 阅读全文

posted @ 2021-06-25 18:37 Ultraman_X 阅读(154) 评论(0) 推荐(0)

2021年6月23日

c++函数调用

摘要: Origin 寄存器: stack pointer(ESP): 保存栈的栈顶指针 base pointer (EBP): 保存栈的栈底指针 instruction ponter(EIP): register containing the address of the instruction to b 阅读全文

posted @ 2021-06-23 17:33 Ultraman_X 阅读(168) 评论(0) 推荐(0)

c++ 运算符重载

摘要: 运算符重载的实质是函数重载: 除了类属关系运算符"."、成员指针运算符".*"、作用域运算符"::"、sizeof运算符和三目运算符"?:"以外,C++中的所有运算符都可以重载。 重载运算符限制在C++语言中已有的运算符范围内的允许重载的运算符之中,不能创建新的运算符。 运算符重载实质上是函数重载, 阅读全文

posted @ 2021-06-23 12:03 Ultraman_X 阅读(308) 评论(0) 推荐(0)

2021年6月21日

C/C++函数调用过程分析

摘要: #include <stdio.h> int func(int param1 ,int param2,int param3) { int var1 = param1; int var2 = param2; int var3 = param3; printf("var1=%d,var2=%d,var3 阅读全文

posted @ 2021-06-21 16:06 Ultraman_X 阅读(422) 评论(0) 推荐(0)

2021年6月17日

Virtual Constructor

摘要: Origin ** Intent: ** To create a copy or new object without knowing its concrete type. ** Implementation** : Exploits overloaded methods with polymorp 阅读全文

posted @ 2021-06-17 10:58 Ultraman_X 阅读(68) 评论(0) 推荐(0)

CRTP ( The Curiously Recurring Template Pattern)

摘要: CRTP ( The Curiously Recurring Template Pattern) 什么是CRTP 继承自模板类 子类将自己作为模板参数传递给父类 如下: template <typename T> class Base { ... }; class Derived : public 阅读全文

posted @ 2021-06-17 10:51 Ultraman_X 阅读(133) 评论(0) 推荐(0)

2021年6月16日

mutable 关键字

摘要: mutable ####理解 mutable字面意思是可变的,其实直接定义的local variable都是可变的,所以mutable对于修饰普通的local variable是没有意义的。事实上,编译器会禁止你这么做: #include <iostream> int main() { mutabl 阅读全文

posted @ 2021-06-16 16:10 Ultraman_X 阅读(229) 评论(0) 推荐(0)

2021年6月15日

decltype 关键字

摘要: decltype 有的时候我们还会遇到这种情况,我们希望从表达式中推断出要定义变量的类型,但却不想用表达式的值去初始化变量。还有可能是函数的返回类型为某表达式的值类型。在这些时候auto显得就无力了,所以C++11又引入了第二种类型说明符decltype,它的作用是选择并返回操作数的数据类型 dec 阅读全文

posted @ 2021-06-15 18:26 Ultraman_X 阅读(72) 评论(0) 推荐(0)

2021年6月4日

t

摘要: class Solution { public: bool searchHOne(const vector<vector<int>>& matrix,int h,int s,int e,int target) { if(s > e) return false; if(matrix[h][s] == 阅读全文

posted @ 2021-06-04 18:26 Ultraman_X 阅读(37) 评论(0) 推荐(0)

2021年6月2日

红黑树 RBTree

摘要: 红黑树 原文 介绍 红黑树也是二叉查找树,我们知道,二叉查找树这一数据结构并不难,而红黑树之所以难是难在它是自平衡的二叉查找树,在进行插入和删除等可能会破坏树的平衡的操作时,需要重新自处理达到平衡状态。现在在脑海想下怎么实现?是不是太多情景需要考虑了?啧啧,先别急,通过本文的学习后,你会觉得,其实也 阅读全文

posted @ 2021-06-02 16:01 Ultraman_X 阅读(57) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 下一页

导航