std::vector存放类的指针避免拷贝构造函数的调用

#include <iostream> #include <vector> using namespace std; class A { public: A() { printf("A()\n"); } ~A() { printf("~A()\n"); } A(const A& other) { printf("copy\n"); } }; int m
相关文章
相关标签/搜索