Skip to content

Commit

Permalink
Remove uses of BOOST_SP_NOEXCEPT from scoped_ptr.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 2, 2024
1 parent 8a68e56 commit c396b91
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions include/boost/smart_ptr/scoped_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template<class T> class scoped_ptr // noncopyable

typedef T element_type;

explicit scoped_ptr( T * p = 0 ) BOOST_SP_NOEXCEPT : px( p )
explicit scoped_ptr( T * p = 0 ) noexcept : px( p )
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
boost::sp_scalar_constructor_hook( px );
Expand All @@ -72,7 +72,7 @@ template<class T> class scoped_ptr // noncopyable

#ifndef BOOST_NO_AUTO_PTR

explicit scoped_ptr( std::auto_ptr<T> p ) BOOST_SP_NOEXCEPT : px( p.release() )
explicit scoped_ptr( std::auto_ptr<T> p ) noexcept : px( p.release() )
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
boost::sp_scalar_constructor_hook( px );
Expand All @@ -81,7 +81,7 @@ template<class T> class scoped_ptr // noncopyable

#endif

~scoped_ptr() BOOST_SP_NOEXCEPT
~scoped_ptr() noexcept
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
boost::sp_scalar_destructor_hook( px );
Expand All @@ -107,52 +107,52 @@ template<class T> class scoped_ptr // noncopyable
return px;
}

T * get() const BOOST_SP_NOEXCEPT
T * get() const noexcept
{
return px;
}

explicit operator bool () const BOOST_SP_NOEXCEPT
explicit operator bool () const noexcept
{
return px != 0;
}

void swap(scoped_ptr & b) BOOST_SP_NOEXCEPT
void swap(scoped_ptr & b) noexcept
{
T * tmp = b.px;
b.px = px;
px = tmp;
}
};

template<class T> inline bool operator==( scoped_ptr<T> const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT
template<class T> inline bool operator==( scoped_ptr<T> const & p, std::nullptr_t ) noexcept
{
return p.get() == 0;
}

template<class T> inline bool operator==( std::nullptr_t, scoped_ptr<T> const & p ) BOOST_SP_NOEXCEPT
template<class T> inline bool operator==( std::nullptr_t, scoped_ptr<T> const & p ) noexcept
{
return p.get() == 0;
}

template<class T> inline bool operator!=( scoped_ptr<T> const & p, std::nullptr_t ) BOOST_SP_NOEXCEPT
template<class T> inline bool operator!=( scoped_ptr<T> const & p, std::nullptr_t ) noexcept
{
return p.get() != 0;
}

template<class T> inline bool operator!=( std::nullptr_t, scoped_ptr<T> const & p ) BOOST_SP_NOEXCEPT
template<class T> inline bool operator!=( std::nullptr_t, scoped_ptr<T> const & p ) noexcept
{
return p.get() != 0;
}

template<class T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) BOOST_SP_NOEXCEPT
template<class T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) noexcept
{
a.swap(b);
}

// get_pointer(p) is a generic way to say p.get()

template<class T> inline T * get_pointer(scoped_ptr<T> const & p) BOOST_SP_NOEXCEPT
template<class T> inline T * get_pointer(scoped_ptr<T> const & p) noexcept
{
return p.get();
}
Expand Down

0 comments on commit c396b91

Please sign in to comment.