C++ unique_ptr initialization through constructor : <p>I have simple (I suppose) problem with my C++ code. Each time I initialize unique_ptr through constructor I'm getting the same problem: </p>

<blockquote>
  <p><strong>munmap_chunk(): invalid pointer: 0x00007ffc40ba6bf0</strong></p>
</blockquote>

<p>Here's the code:</p>

<p>1) Private part of the class:</p>

<pre><code>template&lt;typename T&gt;
class Node{
  typedef std::unique_ptr&lt;Node&gt; ptr;
  T value;
  ptr left, right;
</code></pre>

<p>2) Constructor initializing ptr left and ptr right:</p>

<pre><code>explicit Node(const T value, Node* left = nullptr, Node* right = nullptr):
  value{value}, left{left}, right{right} {}
</code></pre>

<p>What is the problem here? Thanks for clarification or pointing me in the right direction. </p>
