// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

class Test
{
   public:
      Test()
      {
         cout << (int)this << " constructed" << endl;
      }
      ~Test()
      {
         cout << (int)this << " destructed" << endl;
      }
      Test(const Test& rhs)
      {
         cout << "copy from " << (int)&rhs << " to " << (int)this << endl;
      }
      void operator=(const Test& rhs)
      {
         cout << "assignment from " << (int)&rhs << " to " << (int)this << endl;
      }
};

Test f()
{
   Test res;
   return res;
}

int main()
{
   Test a;
   a = f();
   return 0;
}
