Skip to content

Commit

Permalink
Remove uses of BOOST_SP_NOEXCEPT from sp_counted_base_nt.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 2, 2024
1 parent c7e9113 commit 371d4bf
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions include/boost/smart_ptr/detail/sp_counted_base_nt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
//

#include <boost/smart_ptr/detail/sp_typeinfo_.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>

Expand Down Expand Up @@ -48,43 +47,43 @@ class BOOST_SYMBOL_VISIBLE sp_counted_base

public:

sp_counted_base() BOOST_SP_NOEXCEPT: use_count_( 1 ), weak_count_( 1 )
sp_counted_base() noexcept: use_count_( 1 ), weak_count_( 1 )
{
}

virtual ~sp_counted_base() /*BOOST_SP_NOEXCEPT*/
virtual ~sp_counted_base() /*noexcept*/
{
}

// dispose() is called when use_count_ drops to zero, to release
// the resources managed by *this.

virtual void dispose() BOOST_SP_NOEXCEPT = 0; // nothrow
virtual void dispose() noexcept = 0; // nothrow

// destroy() is called when weak_count_ drops to zero.

virtual void destroy() BOOST_SP_NOEXCEPT // nothrow
virtual void destroy() noexcept // nothrow
{
delete this;
}

virtual void * get_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0;
virtual void * get_local_deleter( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0;
virtual void * get_untyped_deleter() BOOST_SP_NOEXCEPT = 0;
virtual void * get_deleter( sp_typeinfo_ const & ti ) noexcept = 0;
virtual void * get_local_deleter( sp_typeinfo_ const & ti ) noexcept = 0;
virtual void * get_untyped_deleter() noexcept = 0;

void add_ref_copy() BOOST_SP_NOEXCEPT
void add_ref_copy() noexcept
{
++use_count_;
}

bool add_ref_lock() BOOST_SP_NOEXCEPT // true on success
bool add_ref_lock() noexcept // true on success
{
if( use_count_ == 0 ) return false;
++use_count_;
return true;
}

void release() BOOST_SP_NOEXCEPT
void release() noexcept
{
if( --use_count_ == 0 )
{
Expand All @@ -93,20 +92,20 @@ class BOOST_SYMBOL_VISIBLE sp_counted_base
}
}

void weak_add_ref() BOOST_SP_NOEXCEPT
void weak_add_ref() noexcept
{
++weak_count_;
}

void weak_release() BOOST_SP_NOEXCEPT
void weak_release() noexcept
{
if( --weak_count_ == 0 )
{
destroy();
}
}

long use_count() const BOOST_SP_NOEXCEPT
long use_count() const noexcept
{
return use_count_;
}
Expand Down

0 comments on commit 371d4bf

Please sign in to comment.