title: interface function getting rvalue pointers to initialize shared_ptr
body: <p>I have a class exposing through it's interface add function:</p>
  
  <pre><code>void AddObject(Object *o);
  </code></pre>
  
  <p>Inside the class I maintain the objects in <code>set&lt;shared_ptr&lt;Object&gt;&gt;</code>.
  Since I will create <code>shared_ptr</code> from the received pointer I thought to limit the function argument to only rvalue pointers so to make sure that the user will not delete the pointer I use. And so I'll change the function declaration to:</p>
  
  <pre><code>void AddObject(Object* &amp;&amp;o);
  </code></pre>
  
  <p>so a typical use will be:</p>
  
  <pre><code>AddObject(new Object())
  </code></pre>
  
  <p>preventing the user to accidentally delete pointer I hold.
  I don't want to to use <code>shared_ptr</code> in the interface because the user is not familiar with <code>shared_ptr</code>.
  Do you think my suggestion is a good idea?</p>