15
15
#ifndef BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
16
16
#define BOOST_SMART_PTR_INTRUSIVE_REF_COUNTER_HPP_INCLUDED_
17
17
18
- #include < boost/config.hpp>
19
18
#include < boost/smart_ptr/detail/atomic_count.hpp>
20
- #include < boost/smart_ptr/detail/sp_noexcept .hpp>
19
+ #include < boost/config .hpp>
21
20
22
21
#ifdef BOOST_HAS_PRAGMA_ONCE
23
22
#pragma once
@@ -46,17 +45,17 @@ struct thread_unsafe_counter
46
45
{
47
46
typedef unsigned int type;
48
47
49
- static unsigned int load (unsigned int const & counter) BOOST_SP_NOEXCEPT
48
+ static unsigned int load (unsigned int const & counter) noexcept
50
49
{
51
50
return counter;
52
51
}
53
52
54
- static void increment (unsigned int & counter) BOOST_SP_NOEXCEPT
53
+ static void increment (unsigned int & counter) noexcept
55
54
{
56
55
++counter;
57
56
}
58
57
59
- static unsigned int decrement (unsigned int & counter) BOOST_SP_NOEXCEPT
58
+ static unsigned int decrement (unsigned int & counter) noexcept
60
59
{
61
60
return --counter;
62
61
}
@@ -72,17 +71,17 @@ struct thread_safe_counter
72
71
{
73
72
typedef boost::detail::atomic_count type;
74
73
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
76
75
{
77
76
return static_cast < unsigned int >(static_cast < long >(counter));
78
77
}
79
78
80
- static void increment (boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT
79
+ static void increment (boost::detail::atomic_count& counter) noexcept
81
80
{
82
81
++counter;
83
82
}
84
83
85
- static unsigned int decrement (boost::detail::atomic_count& counter) BOOST_SP_NOEXCEPT
84
+ static unsigned int decrement (boost::detail::atomic_count& counter) noexcept
86
85
{
87
86
return static_cast < unsigned int >(--counter);
88
87
}
@@ -92,9 +91,9 @@ template< typename DerivedT, typename CounterPolicyT = thread_safe_counter >
92
91
class intrusive_ref_counter ;
93
92
94
93
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 ;
96
95
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 ;
98
97
99
98
/* !
100
99
* \brief A reference counter base class
@@ -122,7 +121,7 @@ class intrusive_ref_counter
122
121
*
123
122
* \post <tt>use_count() == 0</tt>
124
123
*/
125
- intrusive_ref_counter () BOOST_SP_NOEXCEPT : m_ref_counter(0 )
124
+ intrusive_ref_counter () noexcept : m_ref_counter(0 )
126
125
{
127
126
}
128
127
@@ -131,7 +130,7 @@ class intrusive_ref_counter
131
130
*
132
131
* \post <tt>use_count() == 0</tt>
133
132
*/
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 )
135
134
{
136
135
}
137
136
@@ -140,12 +139,12 @@ class intrusive_ref_counter
140
139
*
141
140
* \post The reference counter is not modified after assignment
142
141
*/
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 ; }
144
143
145
144
/* !
146
145
* \return The reference counter
147
146
*/
148
- unsigned int use_count () const BOOST_SP_NOEXCEPT
147
+ unsigned int use_count () const noexcept
149
148
{
150
149
return CounterPolicyT::load (m_ref_counter);
151
150
}
@@ -156,18 +155,18 @@ class intrusive_ref_counter
156
155
*/
157
156
BOOST_DEFAULTED_FUNCTION (~intrusive_ref_counter (), {})
158
157
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 ;
161
160
};
162
161
163
162
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
165
164
{
166
165
CounterPolicyT::increment (p->m_ref_counter );
167
166
}
168
167
169
168
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
171
170
{
172
171
if (CounterPolicyT::decrement (p->m_ref_counter ) == 0 )
173
172
delete static_cast < const DerivedT* >(p);
0 commit comments