| 14 | A(A& a):pointer(new int(*a.pointer)) { std::cout << "拷贝" << pointer << std::endl; } // 无意义的对象拷贝 |
| 15 | A(A&& a):pointer(a.pointer) { a.pointer = nullptr;std::cout << "移动" << pointer << std::endl; } |
| 16 | ~A(){ std::cout << "析构" << pointer << std::endl; delete pointer; } |
| 17 | }; |
| 18 | // 防止编译器优化 |
| 19 | A return_rvalue(bool test) { |
nothing calls this directly
no outgoing calls
no test coverage detected