Skip to content

Commit a71250e

Browse files
committed
Remove uses of BOOST_SP_NOEXCEPT from intrusive_ref_counter.hpp
1 parent a144ae0 commit a71250e

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

include/boost/smart_ptr/intrusive_ref_counter.hpp

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
#ifndef BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
1616
#define BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
1717

18-
#include <boost/config.hpp>
1918
#include <boost/smart_ptr/detail/atomic_count.hpp>
20-
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
19+
#include <boost/config.hpp>
2120

2221
#ifdef BOOST_HAS_PRAGMA_ONCE
2322
#pragma once
@@ -46,17 +45,17 @@ struct thread_unsafe_counter
4645
{
4746
typedef unsigned int type;
4847

49-
static unsigned int load(unsigned int const& counter) BOOST_SP_NOEXCEPT
48+
static unsigned int load(unsigned int const& counter) noexcept
5049
{
5150
return counter;
5251
}
5352

54-
static void increment(unsigned int& counter) BOOST_SP_NOEXCEPT
53+
static void increment(unsigned int& counter) noexcept
5554
{
5655
++counter;
5756
}
5857

59-
static unsigned int decrement(unsigned int& counter) BOOST_SP_NOEXCEPT
58+
static unsigned int decrement(unsigned int& counter) noexcept
6059
{
6160
return --counter;
6261
}
@@ -72,17 +71,17 @@ struct thread_safe_counter
7271
{
7372
typedef boost::detail::atomic_count type;
7473

75-
static unsigned int load(boost::detail::atomic_count const& counter) BOOST_SP_NOEXCEPT
74+
static unsigned int load(boost::detail::atomic_count const& counter) noexcept
7675
{
7776
return static_cast< unsigned int >(static_cast< long >(counter));
7877
}
7978

80-
static void increment(boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT
79+
static void increment(boost::detail::atomic_count& counter) noexcept
8180
{
8281
++counter;
8382
}
8483

85-
static unsigned int decrement(boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT
84+
static unsigned int decrement(boost::detail::atomic_count& counter) noexcept
8685
{
8786
return static_cast< unsigned int >(--counter);
8887
}
@@ -92,9 +91,9 @@ template< typename DerivedT, typename CounterPolicyT = thread_safe_counter >
9291
class intrusive_ref_counter;
9392

9493
template< typename DerivedT, typename CounterPolicyT >
95-
void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
94+
void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept;
9695
template< typename DerivedT, typename CounterPolicyT >
97-
void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
96+
void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept;
9897

9998
/*!
10099
* \brief A reference counter base class
@@ -122,7 +121,7 @@ class intrusive_ref_counter
122121
*
123122
* \post <tt>use_count() == 0</tt>
124123
*/
125-
intrusive_ref_counter() BOOST_SP_NOEXCEPT : m_ref_counter(0)
124+
intrusive_ref_counter() noexcept : m_ref_counter(0)
126125
{
127126
}
128127

@@ -131,7 +130,7 @@ class intrusive_ref_counter
131130
*
132131
* \post <tt>use_count() == 0</tt>
133132
*/
134-
intrusive_ref_counter(intrusive_ref_counter const&) BOOST_SP_NOEXCEPT : m_ref_counter(0)
133+
intrusive_ref_counter(intrusive_ref_counter const&) noexcept : m_ref_counter(0)
135134
{
136135
}
137136

@@ -140,12 +139,12 @@ class intrusive_ref_counter
140139
*
141140
* \post The reference counter is not modified after assignment
142141
*/
143-
intrusive_ref_counter& operator= (intrusive_ref_counter const&) BOOST_SP_NOEXCEPT { return *this; }
142+
intrusive_ref_counter& operator= (intrusive_ref_counter const&) noexcept { return *this; }
144143

145144
/*!
146145
* \return The reference counter
147146
*/
148-
unsigned int use_count() const BOOST_SP_NOEXCEPT
147+
unsigned int use_count() const noexcept
149148
{
150149
return CounterPolicyT::load(m_ref_counter);
151150
}
@@ -156,18 +155,18 @@ class intrusive_ref_counter
156155
*/
157156
BOOST_DEFAULTED_FUNCTION(~intrusive_ref_counter(), {})
158157

159-
friend void intrusive_ptr_add_ref< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
160-
friend void intrusive_ptr_release< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT;
158+
friend void intrusive_ptr_add_ref< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept;
159+
friend void intrusive_ptr_release< DerivedT, CounterPolicyT >(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept;
161160
};
162161

163162
template< typename DerivedT, typename CounterPolicyT >
164-
inline void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT
163+
inline void intrusive_ptr_add_ref(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept
165164
{
166165
CounterPolicyT::increment(p->m_ref_counter);
167166
}
168167

169168
template< typename DerivedT, typename CounterPolicyT >
170-
inline void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) BOOST_SP_NOEXCEPT
169+
inline void intrusive_ptr_release(const intrusive_ref_counter< DerivedT, CounterPolicyT >* p) noexcept
171170
{
172171
if (CounterPolicyT::decrement(p->m_ref_counter) == 0)
173172
delete static_cast< const DerivedT* >(p);

0 commit comments

Comments
 (0)