#include <boost/smart_ptr/detail/sp_counted_base.hpp>
#include <boost/smart_ptr/detail/sp_counted_impl.hpp>
#include <boost/smart_ptr/detail/sp_disable_deprecated.hpp>
-#include <boost/detail/workaround.hpp>
+#include <boost/smart_ptr/detail/sp_noexcept.hpp>
+#include <boost/config/workaround.hpp>
// In order to avoid circular dependencies with Boost.TR1
// we make sure that our include of <memory> doesn't try to
// pull in the TR1 headers: that's why we use this header
public:
- BOOST_CONSTEXPR shared_count(): pi_(0) // nothrow
+ BOOST_CONSTEXPR shared_count() BOOST_SP_NOEXCEPT: pi_(0)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
{
}
- BOOST_CONSTEXPR explicit shared_count( sp_counted_base * pi ): pi_( pi ) // nothrow
+ BOOST_CONSTEXPR explicit shared_count( sp_counted_base * pi ) BOOST_SP_NOEXCEPT: pi_( pi )
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
r.release();
}
- ~shared_count() // nothrow
+ ~shared_count() /*BOOST_SP_NOEXCEPT*/
{
if( pi_ != 0 ) pi_->release();
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
#endif
}
- shared_count(shared_count const & r): pi_(r.pi_) // nothrow
+ shared_count(shared_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
- shared_count(shared_count && r): pi_(r.pi_) // nothrow
+ shared_count(shared_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif
#endif
explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
- shared_count( weak_count const & r, sp_nothrow_tag ); // constructs an empty *this when r.use_count() == 0
+ shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT; // constructs an empty *this when r.use_count() == 0
- shared_count & operator= (shared_count const & r) // nothrow
+ shared_count & operator= (shared_count const & r) BOOST_SP_NOEXCEPT
{
sp_counted_base * tmp = r.pi_;
return *this;
}
- void swap(shared_count & r) // nothrow
+ void swap(shared_count & r) BOOST_SP_NOEXCEPT
{
sp_counted_base * tmp = r.pi_;
r.pi_ = pi_;
pi_ = tmp;
}
- long use_count() const // nothrow
+ long use_count() const BOOST_SP_NOEXCEPT
{
return pi_ != 0? pi_->use_count(): 0;
}
- bool unique() const // nothrow
+ bool unique() const BOOST_SP_NOEXCEPT
{
return use_count() == 1;
}
- bool empty() const // nothrow
+ bool empty() const BOOST_SP_NOEXCEPT
{
return pi_ == 0;
}
- friend inline bool operator==(shared_count const & a, shared_count const & b)
+ friend inline bool operator==(shared_count const & a, shared_count const & b) BOOST_SP_NOEXCEPT
{
return a.pi_ == b.pi_;
}
- friend inline bool operator<(shared_count const & a, shared_count const & b)
+ friend inline bool operator<(shared_count const & a, shared_count const & b) BOOST_SP_NOEXCEPT
{
return std::less<sp_counted_base *>()( a.pi_, b.pi_ );
}
- void * get_deleter( sp_typeinfo const & ti ) const
+ void * get_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT
{
return pi_? pi_->get_deleter( ti ): 0;
}
- void * get_local_deleter( sp_typeinfo const & ti ) const
+ void * get_local_deleter( sp_typeinfo_ const & ti ) const BOOST_SP_NOEXCEPT
{
return pi_? pi_->get_local_deleter( ti ): 0;
}
- void * get_untyped_deleter() const
+ void * get_untyped_deleter() const BOOST_SP_NOEXCEPT
{
return pi_? pi_->get_untyped_deleter(): 0;
}
public:
- BOOST_CONSTEXPR weak_count(): pi_(0) // nothrow
+ BOOST_CONSTEXPR weak_count() BOOST_SP_NOEXCEPT: pi_(0)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(weak_count_id)
#endif
{
}
- weak_count(shared_count const & r): pi_(r.pi_) // nothrow
+ weak_count(shared_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(weak_count_id)
#endif
if(pi_ != 0) pi_->weak_add_ref();
}
- weak_count(weak_count const & r): pi_(r.pi_) // nothrow
+ weak_count(weak_count const & r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(weak_count_id)
#endif
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
- weak_count(weak_count && r): pi_(r.pi_) // nothrow
+ weak_count(weak_count && r) BOOST_SP_NOEXCEPT: pi_(r.pi_)
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(weak_count_id)
#endif
#endif
- ~weak_count() // nothrow
+ ~weak_count() /*BOOST_SP_NOEXCEPT*/
{
if(pi_ != 0) pi_->weak_release();
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
#endif
}
- weak_count & operator= (shared_count const & r) // nothrow
+ weak_count & operator= (shared_count const & r) BOOST_SP_NOEXCEPT
{
sp_counted_base * tmp = r.pi_;
return *this;
}
- weak_count & operator= (weak_count const & r) // nothrow
+ weak_count & operator= (weak_count const & r) BOOST_SP_NOEXCEPT
{
sp_counted_base * tmp = r.pi_;
return *this;
}
- void swap(weak_count & r) // nothrow
+ void swap(weak_count & r) BOOST_SP_NOEXCEPT
{
sp_counted_base * tmp = r.pi_;
r.pi_ = pi_;
pi_ = tmp;
}
- long use_count() const // nothrow
+ long use_count() const BOOST_SP_NOEXCEPT
{
return pi_ != 0? pi_->use_count(): 0;
}
- bool empty() const // nothrow
+ bool empty() const BOOST_SP_NOEXCEPT
{
return pi_ == 0;
}
- friend inline bool operator==(weak_count const & a, weak_count const & b)
+ friend inline bool operator==(weak_count const & a, weak_count const & b) BOOST_SP_NOEXCEPT
{
return a.pi_ == b.pi_;
}
- friend inline bool operator<(weak_count const & a, weak_count const & b)
+ friend inline bool operator<(weak_count const & a, weak_count const & b) BOOST_SP_NOEXCEPT
{
return std::less<sp_counted_base *>()(a.pi_, b.pi_);
}
}
}
-inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ): pi_( r.pi_ )
+inline shared_count::shared_count( weak_count const & r, sp_nothrow_tag ) BOOST_SP_NOEXCEPT: pi_( r.pi_ )
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
, id_(shared_count_id)
#endif