1移动赋值运算符.cpp#include#includeusing namespace std;class my_string{ char* p=nullptr; public: my_string(){} my_string(const char* s){... Read More
1 c++ 移动构造函数.cpp#include#includeusing namespace std;class my_string{ char* p=nullptr; public: my_string(){} my_string(const char*... Read More
#includeusing namespace std;int main(){ //左值: int a=10; int b=9; //右值: /* a+b,add(a,b),1000,'a',"123"; */ //左值引用... Read More
#includeusing namespace std;class auto_pint{ class node{ public: int ref_count=0; int number=0; }; node * p =nu... Read More
01_lambda表达式.cpp#include#includeusing namespace std;class Func_call{ public:// Func_call(){coutbool 尾置返回类型 //{} 执行体 ... Read More
01_重载函数调用运算符.cpp#includeusing namespace std;class Func_call{ public: Func_call(){coutb; }};int main(){ Func_call fc /*()*/;//具名对象... Read More
1重载类型转换运算符.cpp#includeusing namespace std;class A{ public: int m=0; A()=default; A(int k){m=k;} ~A(){} operator int() { ... Read More
1 C++ 重载解引用_迭代器.cpp#include#includeusing namespace std;//实现迭代器的目的是可以进行泛型计算,比如使用范围for语句等等;//实现迭代器的步骤://1,定义一个内部类iterator//2,重载该内部类的!=, ++, */... Read More
#include#include#includeusing namespace std;class dynamic_int_array{ int * p=nullptr; int size =0; int capacity=0; public: dyn... Read More
1 赋值运算符重载.cpp#include#includeusing namespace std;class my_string{ char* p=nullptr; public: my_string(){} my_string(const char* s)... Read More