title: Create a vector of shared_ptr to ints
body: <p>Attempting to create a vector of shared_ptr to int.</p>
  
  <p>Where am I going wrong? Thanks. Keith :^)</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;memory&gt;
  
  int main() {
      std::vector&lt;std::shared_ptr&lt;int&gt; &gt; w;
      std::vector&lt;std::shared_ptr&lt;int&gt; &gt;::iterator it_w;
      w.push_back(new int(7));
  
      std::cout &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Compiler result:</p>
  
  <pre><code>pickledegg&gt; g++ -std=c++11 -o shared_ptr shared_ptr.cpp
  shared_ptr.cpp:29:4: error: no matching member function for call to 'push_back'
          w.push_back(new int(7));
          ~~^~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:697:36: note: 
        candidate function not viable: no known conversion from 'int *' to 'const value_type' (aka
        'const std::__1::shared_ptr&lt;int&gt;') for 1st argument
      _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
                                     ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector:699:36: note: 
        candidate function not viable: no known conversion from 'int *' to 'value_type' (aka
        'std::__1::shared_ptr&lt;int&gt;') for 1st argument
      _LIBCPP_INLINE_VISIBILITY void push_back(value_type&amp;&amp; __x);
                                     ^
  1 error generated.
  </code></pre>