title: How to initialize a unique_ptr
body: <p>I'm trying to add a lazy-initialization function to my class. I'm not very proficient with C++. Can someone please tell me how I achieve it.</p>
  
  <p>My class has a private member defined as:</p>
  
  <pre><code>std::unique_ptr&lt;Animal&gt; animal;
  </code></pre>
  
  <p>Here's the original constructor that takes one parameter:</p>
  
  <pre><code>MyClass::MyClass(string file) :
  animal(new Animal(file))
  {}
  </code></pre>
  
  <p>I just added a parameter-less constructor and an Init() function. Here's the Init function I just added:</p>
  
  <pre><code>void MyClass::Init(string file)
  {
      this-&gt;animal = ???;
  }
  </code></pre>
  
  <p>What do I need to write there to make it equivalent to what constructor is doing?</p>