0

This is codes snippet from our codes

void testSmartAssign()
{
  boost::shared_ptr<int> A;
  std::auto_ptr<int> B(new int(9));
  A = B;
}

Is this kind of assignment well defined?

Thanks

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by vijayan121
0

> Is this kind of assignment well defined?

yes; it is well-defined and well-behaved. Calls release() on the auto_ptr.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.