title: Reassign object with different constructor
body: <p>In class <code>MyClass</code>, I have a member <code>Dialog dialog_</code>.</p>
  
  <p>After <code>MyClass</code>'s constructor is called, I want to call a different constructor for <code>dialog_</code> with parameters that are created in <code>MyClass</code>'s constructor (that's why I can't directly call the different constructor for <code>dialog_</code>, but just the default one).</p>
  
  <p>So I tried </p>
  
  <pre><code>dialog_ = Dialog(/* different constr. w/ parameters passed from MyClass */);
  </code></pre>
  
  <p>But that doesn't work. The error is </p>
  
  <pre><code>Error: no operator "=" matches these operands
  operand types are: Dialog = Dialog
  </code></pre>
  
  <p>So I Googled a bit and found in <a href="https://stackoverflow.com/questions/2166099/calling-a-constructor-to-re-initialize-object">this SO thread (3rd answer)</a> a code snippet which I tried:</p>
  
  <pre><code>dialog_.~Dialog();
  new(&amp;dialog_) Dialog(/* different constr. w/ parameters passed from MyClass */);
  </code></pre>
  
  <p>And it works. The answer in the thread though states "<strong>The value of this does not go beyond purely theoretical though. Don't do it in practice. The whole thing is ugly beyond description.</strong>"</p>
  
  <p>So what can I do to solve my problem without using that obviously frowned upon piece of code?</p>
  
  <p>I hope you understand what I'm trying to achieve. Thanks!</p>