#include <iostream>
using namespace std;

struct Tracer {
   Tracer(void)
      :m_name("(none)")
   {
      std::cout << "[" << m_name << "]    " << __PRETTY_FUNCTION__ << std::endl;
   }
   Tracer(const std::string & name)
      :m_name(name)
   {
      std::cout << "[" << m_name << "]    " << __PRETTY_FUNCTION__ << std::endl;
   }
   Tracer(const Tracer & other)
      :m_name("from " + other.m_name)
   {
      std::cout << "[" << m_name << "]    " << __PRETTY_FUNCTION__ << std::endl;
   }
   Tracer & operator=(const Tracer & other) {
      m_name = "from " + other.m_name;
      std::cout << "[" << m_name << "]    " << __PRETTY_FUNCTION__ << std::endl;
      return *this;
   }
   ~Tracer() {
      std::cout << "[" << m_name << "]    " << __PRETTY_FUNCTION__ << std::endl;
   }

   std::string m_name;
};

struct A {
	A() : a( "init. list" ) {}
    Tracer a;
};

struct B {
	B() {
		b = Tracer( "c-tor" );
	}
    Tracer b;
};


int main() {
	{
		A x;
	}
	cout << "1" << endl;
	{
		B x;
	}
	cout << "2" << endl;
	return 0;
}