随笔分类 - [1] C&Cpp
摘要:条款24 》条款24:若所有参数皆需类型转换,请为此采用non-member函数 **
阅读全文
摘要:spdlog 支持only-header(仅头文件) 头文件下载,可以去官网 https://github.com/gabime/spdlog 或者:https://download.csdn.net/download/htj10/88421316?spm=1001.2014.3001.5503 使
阅读全文
摘要:参考:https://blog.csdn.net/HR_Reborn/article/details/130363997 #pragma once class Array { public: Array() : size_(0), data_(nullptr){ } Array(int size)
阅读全文
摘要:代码: #pragma once #include <iostream> #include <string> using namespace std; class CompanyA { public: CompanyA() { } virtual ~CompanyA() { } void sendC
阅读全文
摘要:使用private继承 实现: #pragma once #include "IPerson.h" #include "PersonInfo.h" class CPerson1 : public IPerson, private PersonInfo { public: explicit CPers
阅读全文
摘要:模板方法模式 #include <iostream> using namespace std; class GameCharacter { public : int healthValue() const { //... 做一些事前工作 int rtnValue = doHealthValue();
阅读全文