Skip to content

Commit

Permalink
Remove uses of BOOST_SP_NOEXCEPT from make_shared_object.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 2, 2024
1 parent 2de54d4 commit e19c2b1
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions include/boost/smart_ptr/make_shared_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.

#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/config.hpp>
Expand Down Expand Up @@ -46,7 +45,7 @@ template< class T > class sp_ms_deleter

private:

void destroy() BOOST_SP_NOEXCEPT
void destroy() noexcept
{
if( initialized_ )
{
Expand All @@ -68,39 +67,39 @@ template< class T > class sp_ms_deleter

public:

sp_ms_deleter() BOOST_SP_NOEXCEPT : initialized_( false )
sp_ms_deleter() noexcept : initialized_( false )
{
}

template<class A> explicit sp_ms_deleter( A const & ) BOOST_SP_NOEXCEPT : initialized_( false )
template<class A> explicit sp_ms_deleter( A const & ) noexcept : initialized_( false )
{
}

// optimization: do not copy storage_
sp_ms_deleter( sp_ms_deleter const & ) BOOST_SP_NOEXCEPT : initialized_( false )
sp_ms_deleter( sp_ms_deleter const & ) noexcept : initialized_( false )
{
}

~sp_ms_deleter() BOOST_SP_NOEXCEPT
~sp_ms_deleter() noexcept
{
destroy();
}

void operator()( T * ) BOOST_SP_NOEXCEPT
void operator()( T * ) noexcept
{
destroy();
}

static void operator_fn( T* ) BOOST_SP_NOEXCEPT // operator() can't be static
static void operator_fn( T* ) noexcept // operator() can't be static
{
}

void * address() BOOST_SP_NOEXCEPT
void * address() noexcept
{
return storage_.data_;
}

void set_initialized() BOOST_SP_NOEXCEPT
void set_initialized() noexcept
{
initialized_ = true;
}
Expand All @@ -118,7 +117,7 @@ template< class T, class A > class sp_as_deleter

private:

void destroy() BOOST_SP_NOEXCEPT
void destroy() noexcept
{
if( initialized_ )
{
Expand All @@ -132,35 +131,35 @@ template< class T, class A > class sp_as_deleter

public:

sp_as_deleter( A const & a ) BOOST_SP_NOEXCEPT : a_( a ), initialized_( false )
sp_as_deleter( A const & a ) noexcept : a_( a ), initialized_( false )
{
}

// optimization: do not copy storage_
sp_as_deleter( sp_as_deleter const & r ) BOOST_SP_NOEXCEPT : a_( r.a_), initialized_( false )
sp_as_deleter( sp_as_deleter const & r ) noexcept : a_( r.a_), initialized_( false )
{
}

~sp_as_deleter() BOOST_SP_NOEXCEPT
~sp_as_deleter() noexcept
{
destroy();
}

void operator()( T * ) BOOST_SP_NOEXCEPT
void operator()( T * ) noexcept
{
destroy();
}

static void operator_fn( T* ) BOOST_SP_NOEXCEPT // operator() can't be static
static void operator_fn( T* ) noexcept // operator() can't be static
{
}

void * address() BOOST_SP_NOEXCEPT
void * address() noexcept
{
return storage_.data_;
}

void set_initialized() BOOST_SP_NOEXCEPT
void set_initialized() noexcept
{
initialized_ = true;
}
Expand Down

0 comments on commit e19c2b1

Please sign in to comment.