#include <iostream> #include <vector> class Copy { int m_a; public: Copy() { std::cout<<"Const"<<std::endl; } Copy(int c) { m_a = c; } ~Copy() { std::cout<<"Dest"<<std::endl; } void func(const Copy &c) { m_a = c.m_a; } int Result() { return m_a; } }; int main() { Copy c(10); Copy c2=c; int a = c2.Result(); std::cout<<a<<std::endl; return 0; }
Copy(const Copy& other)
main()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)