C++03 에서는 union 안에 NonTrivial한 생성자, 소멸자를 가지는 object 를 넣을 수 없었음
C++11 부터는 가능함, 대신에 컴파일러가 자동생성해 주지 않으므로 직접 만들어 줘야 함
#include <new>
structPoint{Point(){}Point(intx,inty):m_x(x),m_y(y){}intm_x,m_y;};unionU{intz;doublew;Pointp;// Invalid in C++03; valid in C++11.U(){}// Due to the Point member, a constructor definition is now needed.U(constPoint&pt):p(pt){}// Construct Point object using initializer list.U&operator=(constPoint&pt){new(&p)Point(pt);return*this;}// Assign Point object using placement 'new'.};