Given the following code
class foo
{
private:
boost::shared_ptr <std::deque<foo> > m_ptr;
public:
foo();
boost::shared_ptr <std::deque<foo> > get_my_ptr()
{
return m_ptr;
}
};
And when we call a get_my_ptr()
function like this
boost::shared_ptr <std::deque<foo> > ptr = get_my_ptr()
Does the copy constructor make a compiler call to create the ptr object, or can it execute nrvo? And what is the difference that we call so
const boost::shared_ptr <std::deque<foo> >& ptr = get_my_ptr()
user1886376
source
share