Skip to content

Commit

Permalink
Remove uses of BOOST_SP_NOEXCEPT from enable_shared_from_this.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 2, 2024
1 parent 33ac315 commit 0bb0b0d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions include/boost/smart_ptr/enable_shared_from_this.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
#include <boost/assert.hpp>
#include <boost/config.hpp>

Expand All @@ -26,20 +25,20 @@ template<class T> class enable_shared_from_this
{
protected:

BOOST_CONSTEXPR enable_shared_from_this() BOOST_SP_NOEXCEPT
BOOST_CONSTEXPR enable_shared_from_this() noexcept
{
}

BOOST_CONSTEXPR enable_shared_from_this(enable_shared_from_this const &) BOOST_SP_NOEXCEPT
BOOST_CONSTEXPR enable_shared_from_this(enable_shared_from_this const &) noexcept
{
}

enable_shared_from_this & operator=(enable_shared_from_this const &) BOOST_SP_NOEXCEPT
enable_shared_from_this & operator=(enable_shared_from_this const &) noexcept
{
return *this;
}

~enable_shared_from_this() BOOST_SP_NOEXCEPT // ~weak_ptr<T> newer throws, so this call also must not throw
~enable_shared_from_this() noexcept // ~weak_ptr<T> newer throws, so this call also must not throw
{
}

Expand All @@ -59,20 +58,20 @@ template<class T> class enable_shared_from_this
return p;
}

weak_ptr<T> weak_from_this() BOOST_SP_NOEXCEPT
weak_ptr<T> weak_from_this() noexcept
{
return weak_this_;
}

weak_ptr<T const> weak_from_this() const BOOST_SP_NOEXCEPT
weak_ptr<T const> weak_from_this() const noexcept
{
return weak_this_;
}

public: // actually private, but avoids compiler template friendship issues

// Note: invoked automatically by shared_ptr; do not call
template<class X, class Y> void _internal_accept_owner( shared_ptr<X> const * ppx, Y * py ) const BOOST_SP_NOEXCEPT
template<class X, class Y> void _internal_accept_owner( shared_ptr<X> const * ppx, Y * py ) const noexcept
{
if( weak_this_.expired() )
{
Expand Down

0 comments on commit 0bb0b0d

Please sign in to comment.