任鸟飞C++逆向安全从零基础到进阶
Str类源码
#include<iostream>#include<string.h>#include<vector>usingnamespacestd;classStr {public:char* str; Str(charvalue[]) {cout<<"Ordinary constructor"<str = (char*)malloc(len +1);memset(str,0, len +1);strcpy(str, value); }//拷贝构造函数Str(constStr& s) {cout<<"copy constructor"<
代码1
main 函数中,不使用 move 语义,会调用拷贝构造函数

