title: shared_ptr to map populated in a method comes back empty in the caller
body: <p>I am initializing a shared_ptr to map in a separate function called GetData. This map is passed as argument to GetData function. However, in the main, map comes back empty after the call to GetData function.</p>
  
  <pre><code>#include &lt;memory&gt;
  #include &lt;map&gt;
  
  void  GetData(std::shared_ptr&lt;std::map&lt;int, int&gt;&gt; data);
  
  int main()
  {
      std::shared_ptr&lt;std::map&lt;int, int&gt;&gt; data2 = std::make_shared&lt;std::map&lt;int, int&gt;&gt;();
      GetData(data2);
      return 0;
  }
  
  void GetData(std::shared_ptr&lt;std::map&lt;int, int&gt;&gt; data)
  {
  
      data = std::make_shared&lt;std::map&lt;int, int&gt;&gt;
          (std::initializer_list&lt;std::map&lt;int, int&gt;::value_type&gt;{
              { 1, 2 },
              { 5, 6 },
              { 4, 5 }
      });
  }
  </code></pre>
  
  <p>What am I doing wrong here?</p>
  
  <p><strong>UPDATE:</strong>
  If I re-write method as follows while parameter still not passed by reference, I do get map populated in the main after call to GetData method. </p>
  
  <pre><code>void GetData(std::shared_ptr&lt;std::map&lt;int, int&gt;&gt; data)
  {
      data-&gt;insert(std::pair&lt;int, int&gt;(1,2));
      data-&gt;insert(std::pair&lt;int, int&gt;(45, 2));
  }
  </code></pre>