diff --git a/include/boost/detail/shared_count.hpp b/include/boost/detail/shared_count.hpp index cf8f8ee..8756294 100644 --- a/include/boost/detail/shared_count.hpp +++ b/include/boost/detail/shared_count.hpp @@ -16,6 +16,13 @@ // warranty, and with no claim as to its suitability for any purpose. // +#include + +#ifndef BOOST_NO_AUTO_PTR +# include +#endif + +#include #include namespace boost @@ -160,6 +167,18 @@ public: } } +#ifndef BOOST_NO_AUTO_PTR + + // auto_ptr is special cased to provide the strong guarantee + + template + explicit shared_count(std::auto_ptr & r): pi_(new counted_base_impl< Y *, checked_deleter >(r.get(), checked_deleter(), 1, 1)) + { + r.release(); + } + +#endif + ~shared_count() // nothrow { pi_->release();