fork download
#include <iostream>
#include <memory>

struct A{
   int n;
   A(int a):n(a){std::cout<<"A() :"<<n<<std::endl;}
   A(const A& a):n(a.n){ std::cout<<"A(A) :"<<n<<std::endl;}
   A& operator=(const A& a){n=a.n; std::cout<<"= :"<<n<<std::endl;}
   ~A(){std::cout<<"~A() :"<<n<<std::endl;}
};

struct Er{
   Er(){throw 0;}
};

struct B{
   A*  a;
   Er* b;
   A*  c;
   B(){
      /*...*/
   }
};

int main(){
   try{
      B b;
   }
   catch(...){std::cout<<"catch"<<std::endl;}
}
Success #stdin #stdout 0s 2880KB
stdin
Standard input is empty
stdout
Standard output is empty