16
16
// http://www.boost.org/LICENSE_1_0.txt
17
17
18
18
#include < boost/smart_ptr/detail/sp_typeinfo_.hpp>
19
- #include < boost/smart_ptr/detail/sp_noexcept.hpp>
20
19
#include < boost/config.hpp>
21
20
#include < atomic>
22
21
#include < cstdint>
@@ -34,17 +33,17 @@ namespace boost
34
33
namespace detail
35
34
{
36
35
37
- inline void atomic_increment ( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT
36
+ inline void atomic_increment ( std::atomic_int_least32_t * pw ) noexcept
38
37
{
39
38
pw->fetch_add ( 1 , std::memory_order_relaxed );
40
39
}
41
40
42
- inline std::int_least32_t atomic_decrement ( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT
41
+ inline std::int_least32_t atomic_decrement ( std::atomic_int_least32_t * pw ) noexcept
43
42
{
44
43
return pw->fetch_sub ( 1 , std::memory_order_acq_rel );
45
44
}
46
45
47
- inline std::int_least32_t atomic_conditional_increment ( std::atomic_int_least32_t * pw ) BOOST_SP_NOEXCEPT
46
+ inline std::int_least32_t atomic_conditional_increment ( std::atomic_int_least32_t * pw ) noexcept
48
47
{
49
48
// long r = *pw;
50
49
// if( r != 0 ) ++*pw;
@@ -78,41 +77,41 @@ class BOOST_SYMBOL_VISIBLE sp_counted_base
78
77
79
78
public:
80
79
81
- sp_counted_base () BOOST_SP_NOEXCEPT : use_count_( 1 ), weak_count_( 1 )
80
+ sp_counted_base () noexcept : use_count_( 1 ), weak_count_( 1 )
82
81
{
83
82
}
84
83
85
- virtual ~sp_counted_base () /* BOOST_SP_NOEXCEPT */
84
+ virtual ~sp_counted_base () /* noexcept */
86
85
{
87
86
}
88
87
89
88
// dispose() is called when use_count_ drops to zero, to release
90
89
// the resources managed by *this.
91
90
92
- virtual void dispose () BOOST_SP_NOEXCEPT = 0;
91
+ virtual void dispose () noexcept = 0;
93
92
94
93
// destroy() is called when weak_count_ drops to zero.
95
94
96
- virtual void destroy () BOOST_SP_NOEXCEPT
95
+ virtual void destroy () noexcept
97
96
{
98
97
delete this ;
99
98
}
100
99
101
- virtual void * get_deleter ( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0;
102
- virtual void * get_local_deleter ( sp_typeinfo_ const & ti ) BOOST_SP_NOEXCEPT = 0;
103
- virtual void * get_untyped_deleter () BOOST_SP_NOEXCEPT = 0;
100
+ virtual void * get_deleter ( sp_typeinfo_ const & ti ) noexcept = 0;
101
+ virtual void * get_local_deleter ( sp_typeinfo_ const & ti ) noexcept = 0;
102
+ virtual void * get_untyped_deleter () noexcept = 0;
104
103
105
- void add_ref_copy () BOOST_SP_NOEXCEPT
104
+ void add_ref_copy () noexcept
106
105
{
107
106
atomic_increment ( &use_count_ );
108
107
}
109
108
110
- bool add_ref_lock () BOOST_SP_NOEXCEPT // true on success
109
+ bool add_ref_lock () noexcept // true on success
111
110
{
112
111
return atomic_conditional_increment ( &use_count_ ) != 0 ;
113
112
}
114
113
115
- void release () BOOST_SP_NOEXCEPT
114
+ void release () noexcept
116
115
{
117
116
if ( atomic_decrement ( &use_count_ ) == 1 )
118
117
{
@@ -121,20 +120,20 @@ class BOOST_SYMBOL_VISIBLE sp_counted_base
121
120
}
122
121
}
123
122
124
- void weak_add_ref () BOOST_SP_NOEXCEPT
123
+ void weak_add_ref () noexcept
125
124
{
126
125
atomic_increment ( &weak_count_ );
127
126
}
128
127
129
- void weak_release () BOOST_SP_NOEXCEPT
128
+ void weak_release () noexcept
130
129
{
131
130
if ( atomic_decrement ( &weak_count_ ) == 1 )
132
131
{
133
132
destroy ();
134
133
}
135
134
}
136
135
137
- long use_count () const BOOST_SP_NOEXCEPT
136
+ long use_count () const noexcept
138
137
{
139
138
return use_count_.load ( std::memory_order_acquire );
140
139
}
0 commit comments