title: Accessing std::vector containing boost::shared_ptr<CustomObj> -> does at() return a copy of shared pointer?
body: <p>i am new to boost::shared_ptr using it the first time now. I have a std::vector containing boost::shared_ptr which i "filled" with objects created from a custom class.</p>
  
  <p>In Code: <code>std::vector&lt;boost::shared_ptr&lt;Foo&gt;&gt; data;</code></p>
  
  <p>The vector is created inside a function on the stack. I want to access some elements inside my vector using vector.at(k). The retured shared_ptr will be send to another thread, lets call him T1. My vector runs out of scope while T1 is still processing the shared_ptr. </p>
  
  <p>In Code:</p>
  
  <p><code>
  void myFunction(){</p>
  
  <pre><code>   //lets get my object
     boost::shared_ptr&lt;Foo&gt; obj = data.at(k);
  
     //emit it to Thread T1 (i am using QT)
     emit sendObjToThread1(obj);
  </code></pre>
  
  <p>}
  </code></p>
  
  <p>I previously thought this would give no problem, but since my program is acting very strange, i am about to changing my mind. :) To clarify this i am asking you on this platform now. :) </p>
  
  <p>Is it right, that my object will be destroyed if my vector runs out of scope? If yes, how can i manage to get a deep copy of the shared_ptr (but not the object it holds). Just to have mentioned it: My application is based on QT.</p>
  
  <p>Thx for reading.</p>