随笔 - 52  文章 - 50  评论 - 1  阅读 - 24839

随笔分类 -  C++

常用网站
摘要:设计模式 https://design-patterns.readthedocs.io/zh_CN/latest/structural_patterns/adapter.html 23种设计模式 https://design-patterns.readthedocs.io/zh_CN/latest/ 阅读全文
posted @ 2024-01-27 01:27 蜀山菜鸟 阅读(7) 评论(0) 推荐(0) 编辑
QT下载和安装
摘要:官网开源下载页面: https://www.qt.io/download-open-source 所有版本下载地址 https://download.qt.io/ 5.12.12 下载地址 https://download.qt.io/official_releases/qt/5.12/5.12.1 阅读全文
posted @ 2024-01-27 01:26 蜀山菜鸟 阅读(83) 评论(0) 推荐(0) 编辑
c++变长参数的应用
摘要:c++变长参数应用示例: // C++中C11提供了任意类别的安全的变长参数函数模板(C11之前模板函数参数个数只能固定),使用方法如下: // template<typename... Args> void Func(Args... args); template <typename... Arg 阅读全文
posted @ 2022-05-23 22:11 蜀山菜鸟 阅读(124) 评论(0) 推荐(0) 编辑
const修饰
摘要:const修饰是否能修改,判断性质简便方法:从由往左读,遇到p就替换为“p is a”,遇到*就替换为“point to”,其余不变。 如 const int p; p is a int const. p是一个int型常量 阅读全文
posted @ 2022-05-19 22:00 蜀山菜鸟 阅读(18) 评论(0) 推荐(0) 编辑
适配器,桥接,代理,享元模式示例代码
摘要:适配器模式: // 适配器模式 将一个类的接口转换成客户希望的另外一个接口 // 接口层 class OutInterface { public: virtual ~OutInterface() = default; // 客户希望实现的接口 例如: 用户希望一次性打印姓名 年龄 成绩 virtua 阅读全文
posted @ 2022-05-19 14:57 蜀山菜鸟 阅读(30) 评论(0) 推荐(0) 编辑
代理模式
摘要:class Service { public: int QueryData() { // 服务端,查询数据,订阅数据,修改数据等 cout << "this is service data" << endl; return 0; } }; class CProxy { private: CProxy 阅读全文
posted @ 2022-05-16 21:35 蜀山菜鸟 阅读(18) 评论(0) 推荐(0) 编辑
引用接口赋值
摘要:继承接口赋值的时候,需要采用引用的方式,需要在初始化列表里面初始化 class Parent { public: virtual void ShowEntry() { cout << " entry parent "<< endl; }; }; class Child : public Parent 阅读全文
posted @ 2022-05-16 20:16 蜀山菜鸟 阅读(20) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示