Are there any difference between tr1::shared_ptr
and boost::shared_ptr
? If so, what?
Differences between tr1::shared_ptr and boost::shared_ptr?
Asked Answered
No, the documentation of boost shared_ptr says:
This implementation conforms to the TR1 specification, with the only exception that it resides in namespace boost instead of std::tr1.
Ah. So, there's one difference. –
Floatplane
The implementations may differ while still conforming; Notably
boost::shared_ptr
's dereferencing operators use Boost.Assert
to check for NULL (i.e. emptiness) before performing the dereference; while libc++
's std::shared_ptr
has no such check. In the case you hit this error at runtime, one will mean an assertion failure, the other a segmentation fault (probably). –
Gigahertz © 2022 - 2024 — McMap. All rights reserved.