title: Access member of a iterator of a vector of unique_ptr
body: <p>I have a vector:</p>
  
  <pre><code>std::vector&lt;std::unique_ptr&lt;MyAbstract&gt;&gt; myList;
  </code></pre>
  
  <p>I want to access the member "id" in a loop and erase a specific item:</p>
  
  <pre><code>for (auto it = myList.begin(); it != myList.end();)
  {
      if (it-&gt;id == 2)
      {
          it = myList.erase(it);
          break;
      }
      else
          ++it;
  }
  </code></pre>
  
  <p>this line... </p>
  
  <pre><code>if (it-&gt;id == 2)
  </code></pre>
  
  <p>gives me an error:</p>
  
  <blockquote>
    <p>'class std::unique_ptr' has no member named 'id'</p>
  </blockquote>
  
  <p>This seems to work:</p>
  
  <pre><code>if (it-&gt;get()-&gt;id == 2)
  </code></pre>
  
  <p>I wonder why?! Here's the full code:
  <a href="http://ideone.com/kFohfA" rel="nofollow">http://ideone.com/kFohfA</a></p>