Skip to content

Commit 8217d05

Browse files
committed
Remove uses of BOOST_SP_NOEXCEPT from allocate_unique.hpp
1 parent 29eea45 commit 8217d05

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

include/boost/smart_ptr/allocate_unique.hpp

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Distributed under the Boost Software License, Version 1.0.
88
#ifndef BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
99
#define BOOST_SMART_PTR_ALLOCATE_UNIQUE_HPP
1010

11-
#include <boost/smart_ptr/detail/sp_noexcept.hpp>
1211
#include <boost/core/allocator_access.hpp>
1312
#include <boost/core/alloc_construct.hpp>
1413
#include <boost/core/empty_value.hpp>
@@ -67,41 +66,41 @@ class sp_alloc_ptr {
6766
public:
6867
typedef T element_type;
6968

70-
sp_alloc_ptr() BOOST_SP_NOEXCEPT
69+
sp_alloc_ptr() noexcept
7170
: p_() { }
7271

7372
#if defined(BOOST_MSVC) && BOOST_MSVC == 1600
74-
sp_alloc_ptr(T* p) BOOST_SP_NOEXCEPT
73+
sp_alloc_ptr(T* p) noexcept
7574
: p_(const_cast<typename boost::remove_cv<T>::type*>(p)) { }
7675
#endif
7776

78-
sp_alloc_ptr(std::size_t, P p) BOOST_SP_NOEXCEPT
77+
sp_alloc_ptr(std::size_t, P p) noexcept
7978
: p_(p) { }
8079

81-
sp_alloc_ptr(std::nullptr_t) BOOST_SP_NOEXCEPT
80+
sp_alloc_ptr(std::nullptr_t) noexcept
8281
: p_() { }
8382

8483
T& operator*() const {
8584
return *p_;
8685
}
8786

88-
T* operator->() const BOOST_SP_NOEXCEPT {
87+
T* operator->() const noexcept {
8988
return boost::to_address(p_);
9089
}
9190

92-
explicit operator bool() const BOOST_SP_NOEXCEPT {
91+
explicit operator bool() const noexcept {
9392
return !!p_;
9493
}
9594

96-
bool operator!() const BOOST_SP_NOEXCEPT {
95+
bool operator!() const noexcept {
9796
return !p_;
9897
}
9998

100-
P ptr() const BOOST_SP_NOEXCEPT {
99+
P ptr() const noexcept {
101100
return p_;
102101
}
103102

104-
BOOST_STATIC_CONSTEXPR std::size_t size() BOOST_SP_NOEXCEPT {
103+
BOOST_STATIC_CONSTEXPR std::size_t size() noexcept {
105104
return 1;
106105
}
107106

@@ -122,33 +121,33 @@ class sp_alloc_ptr<T[], P> {
122121
public:
123122
typedef T element_type;
124123

125-
sp_alloc_ptr() BOOST_SP_NOEXCEPT
124+
sp_alloc_ptr() noexcept
126125
: p_() { }
127126

128-
sp_alloc_ptr(std::size_t n, P p) BOOST_SP_NOEXCEPT
127+
sp_alloc_ptr(std::size_t n, P p) noexcept
129128
: p_(p)
130129
, n_(n) { }
131130

132-
sp_alloc_ptr(std::nullptr_t) BOOST_SP_NOEXCEPT
131+
sp_alloc_ptr(std::nullptr_t) noexcept
133132
: p_() { }
134133

135134
T& operator[](std::size_t i) const {
136135
return p_[i];
137136
}
138137

139-
explicit operator bool() const BOOST_SP_NOEXCEPT {
138+
explicit operator bool() const noexcept {
140139
return !!p_;
141140
}
142141

143-
bool operator!() const BOOST_SP_NOEXCEPT {
142+
bool operator!() const noexcept {
144143
return !p_;
145144
}
146145

147-
P ptr() const BOOST_SP_NOEXCEPT {
146+
P ptr() const noexcept {
148147
return p_;
149148
}
150149

151-
std::size_t size() const BOOST_SP_NOEXCEPT {
150+
std::size_t size() const noexcept {
152151
return n_;
153152
}
154153

@@ -170,32 +169,32 @@ class sp_alloc_ptr<T[N], P> {
170169
public:
171170
typedef T element_type;
172171

173-
sp_alloc_ptr() BOOST_SP_NOEXCEPT
172+
sp_alloc_ptr() noexcept
174173
: p_() { }
175174

176-
sp_alloc_ptr(std::size_t, P p) BOOST_SP_NOEXCEPT
175+
sp_alloc_ptr(std::size_t, P p) noexcept
177176
: p_(p) { }
178177

179-
sp_alloc_ptr(std::nullptr_t) BOOST_SP_NOEXCEPT
178+
sp_alloc_ptr(std::nullptr_t) noexcept
180179
: p_() { }
181180

182181
T& operator[](std::size_t i) const {
183182
return p_[i];
184183
}
185184

186-
explicit operator bool() const BOOST_SP_NOEXCEPT {
185+
explicit operator bool() const noexcept {
187186
return !!p_;
188187
}
189188

190-
bool operator!() const BOOST_SP_NOEXCEPT {
189+
bool operator!() const noexcept {
191190
return !p_;
192191
}
193192

194-
P ptr() const BOOST_SP_NOEXCEPT {
193+
P ptr() const noexcept {
195194
return p_;
196195
}
197196

198-
BOOST_STATIC_CONSTEXPR std::size_t size() BOOST_SP_NOEXCEPT {
197+
BOOST_STATIC_CONSTEXPR std::size_t size() noexcept {
199198
return N;
200199
}
201200

@@ -228,31 +227,31 @@ operator!=(const sp_alloc_ptr<T, P>& lhs, const sp_alloc_ptr<T, P>& rhs)
228227
template<class T, class P>
229228
inline bool
230229
operator==(const sp_alloc_ptr<T, P>& lhs,
231-
std::nullptr_t) BOOST_SP_NOEXCEPT
230+
std::nullptr_t) noexcept
232231
{
233232
return !lhs.ptr();
234233
}
235234

236235
template<class T, class P>
237236
inline bool
238237
operator==(std::nullptr_t,
239-
const sp_alloc_ptr<T, P>& rhs) BOOST_SP_NOEXCEPT
238+
const sp_alloc_ptr<T, P>& rhs) noexcept
240239
{
241240
return !rhs.ptr();
242241
}
243242

244243
template<class T, class P>
245244
inline bool
246245
operator!=(const sp_alloc_ptr<T, P>& lhs,
247-
std::nullptr_t) BOOST_SP_NOEXCEPT
246+
std::nullptr_t) noexcept
248247
{
249248
return !!lhs.ptr();
250249
}
251250

252251
template<class T, class P>
253252
inline bool
254253
operator!=(std::nullptr_t,
255-
const sp_alloc_ptr<T, P>& rhs) BOOST_SP_NOEXCEPT
254+
const sp_alloc_ptr<T, P>& rhs) noexcept
256255
{
257256
return !!rhs.ptr();
258257
}
@@ -293,7 +292,7 @@ class alloc_deleter
293292
typedef detail::sp_alloc_ptr<T,
294293
typename allocator_pointer<allocator>::type> pointer;
295294

296-
explicit alloc_deleter(const allocator& a) BOOST_SP_NOEXCEPT
295+
explicit alloc_deleter(const allocator& a) noexcept
297296
: base(empty_init_t(), a) { }
298297

299298
void operator()(pointer p) {
@@ -330,15 +329,15 @@ class sp_alloc_make {
330329
}
331330
}
332331

333-
typename allocator::value_type* get() const BOOST_SP_NOEXCEPT {
332+
typename allocator::value_type* get() const noexcept {
334333
return boost::to_address(p_);
335334
}
336335

337-
allocator& state() BOOST_SP_NOEXCEPT {
336+
allocator& state() noexcept {
338337
return a_;
339338
}
340339

341-
type release() BOOST_SP_NOEXCEPT {
340+
type release() noexcept {
342341
pointer p = p_;
343342
p_ = pointer();
344343
return type(typename deleter::pointer(n_, p), deleter(a_));

0 commit comments

Comments
 (0)