title: Use union to defer member variable construction
body: <p>I want to defer the construction of my member variable until the constructor's body and I am trying to use union to do that. Until now, it's achieving what I want but I want to ask is there any reason I shouldn't do this?</p>
  <p>Example:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  
  struct A {
    A() {
      std::cout &lt;&lt; &quot;Construct A&quot; &lt;&lt; std::endl;
    }
    ~A() {
      std::cout &lt;&lt; &quot;Destruct A&quot; &lt;&lt; std::endl;
    }
  };
  
  struct B {
    A a;
  };
  
  template &lt;typename T&gt;
  union U {
    char a{};
    T buffer;
    U() {}
    ~U() {
      buffer.~T();
    }
  };
  
  struct C {
    U&lt;B&gt; u;
    C() {
      try {
        new (&amp;u.buffer) B();
      } catch (...) {
      }
    }
  };
  </code></pre>
  <p>Edit: Add sample usage</p>