Skip to content

Commit

Permalink
Remove uses of BOOST_NOEXCEPT
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 2, 2024
1 parent 0521c89 commit 554ad5a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion include/boost/smart_ptr/allocate_unique.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ template<class T, class U, class A>
inline typename allocator_pointer<typename allocator_rebind<A,
typename detail::sp_alloc_value<T>::type>::type>::type
get_allocator_pointer(const std::unique_ptr<T,
alloc_deleter<U, A> >& p) BOOST_NOEXCEPT
alloc_deleter<U, A> >& p) noexcept
{
return p.get().ptr();
}
Expand Down
2 changes: 1 addition & 1 deletion include/boost/smart_ptr/detail/shared_count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ template< class D > struct sp_convert_reference< D& >
typedef sp_reference_wrapper< D > type;
};

template<class T> std::size_t sp_hash_pointer( T* p ) BOOST_NOEXCEPT
template<class T> std::size_t sp_hash_pointer( T* p ) noexcept
{
boost::uintptr_t v = reinterpret_cast<boost::uintptr_t>( p );

Expand Down
11 changes: 5 additions & 6 deletions include/boost/smart_ptr/detail/spinlock_std_atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
//

#include <boost/smart_ptr/detail/yield_k.hpp>
#include <boost/config.hpp>
#include <atomic>

#if defined(BOOST_SP_REPORT_IMPLEMENTATION)
Expand All @@ -40,20 +39,20 @@ class spinlock

public:

bool try_lock() BOOST_NOEXCEPT
bool try_lock() noexcept
{
return !v_.test_and_set( std::memory_order_acquire );
}

void lock() BOOST_NOEXCEPT
void lock() noexcept
{
for( unsigned k = 0; !try_lock(); ++k )
{
boost::detail::yield( k );
}
}

void unlock() BOOST_NOEXCEPT
void unlock() noexcept
{
v_ .clear( std::memory_order_release );
}
Expand All @@ -71,12 +70,12 @@ class spinlock

public:

explicit scoped_lock( spinlock & sp ) BOOST_NOEXCEPT: sp_( sp )
explicit scoped_lock( spinlock & sp ) noexcept: sp_( sp )
{
sp.lock();
}

~scoped_lock() /*BOOST_NOEXCEPT*/
~scoped_lock() /*noexcept*/
{
sp_.unlock();
}
Expand Down
4 changes: 1 addition & 3 deletions include/boost/smart_ptr/owner_equal_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt

#include <boost/config.hpp>

namespace boost
{

Expand All @@ -16,7 +14,7 @@ template<class T = void> struct owner_equal_to
typedef T first_argument_type;
typedef T second_argument_type;

template<class U, class V> bool operator()( U const & u, V const & v ) const BOOST_NOEXCEPT
template<class U, class V> bool operator()( U const & u, V const & v ) const noexcept
{
return u.owner_equals( v );
}
Expand Down
3 changes: 1 addition & 2 deletions include/boost/smart_ptr/owner_hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt

#include <boost/config.hpp>
#include <cstddef>

namespace boost
Expand All @@ -16,7 +15,7 @@ template<class T> struct owner_hash
typedef std::size_t result_type;
typedef T argument_type;

std::size_t operator()( T const & t ) const BOOST_NOEXCEPT
std::size_t operator()( T const & t ) const noexcept
{
return t.owner_hash_value();
}
Expand Down
4 changes: 1 addition & 3 deletions include/boost/smart_ptr/owner_less.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
//

#include <boost/config.hpp>

namespace boost
{

Expand All @@ -25,7 +23,7 @@ template<class T = void> struct owner_less
typedef T first_argument_type;
typedef T second_argument_type;

template<class U, class V> bool operator()( U const & u, V const & v ) const BOOST_NOEXCEPT
template<class U, class V> bool operator()( U const & u, V const & v ) const noexcept
{
return u.owner_before( v );
}
Expand Down
2 changes: 1 addition & 1 deletion test/sp_constexpr_test2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct X: public boost::enable_shared_from_this<X>
{
int v_;

constexpr X() BOOST_NOEXCEPT: v_( 1 )
constexpr X() noexcept: v_( 1 )
{
}
};
Expand Down

0 comments on commit 554ad5a

Please sign in to comment.