Skip to content

Commit b8d357c

Browse files
committed
Merge pull request #313 from jonitis/master
c++11 code should use nothrow instead of throw()
2 parents d3450c1 + 4f1e47a commit b8d357c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

include/msgpack/detail/cpp11_zone.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ class zone {
9797

9898
++m_tail;
9999
}
100-
#if !defined(MSGPACK_USE_CPP03)
101100
finalizer_array(finalizer_array&& other) noexcept
102101
:m_tail(other.m_tail), m_end(other.m_end), m_array(other.m_array)
103102
{
@@ -111,7 +110,7 @@ class zone {
111110
new (this) finalizer_array(std::move(other));
112111
return *this;
113112
}
114-
#endif
113+
115114
finalizer* m_tail;
116115
finalizer* m_end;
117116
finalizer* m_array;
@@ -162,7 +161,6 @@ class zone {
162161
m_free = chunk_size;
163162
m_ptr = reinterpret_cast<char*>(m_head) + sizeof(chunk);
164163
}
165-
#if !defined(MSGPACK_USE_CPP03)
166164
chunk_list(chunk_list&& other) noexcept
167165
:m_free(other.m_free), m_ptr(other.m_ptr), m_head(other.m_head)
168166
{
@@ -174,7 +172,7 @@ class zone {
174172
new (this) chunk_list(std::move(other));
175173
return *this;
176174
}
177-
#endif
175+
178176
size_t m_free;
179177
char* m_ptr;
180178
chunk* m_head;
@@ -203,21 +201,21 @@ class zone {
203201
void swap(zone& o);
204202

205203

206-
static void* operator new(std::size_t size) throw(std::bad_alloc)
204+
static void* operator new(std::size_t size)
207205
{
208206
void* p = ::malloc(size);
209207
if (!p) throw std::bad_alloc();
210208
return p;
211209
}
212-
static void operator delete(void *p) throw()
210+
static void operator delete(void *p) noexcept
213211
{
214212
::free(p);
215213
}
216-
static void* operator new(std::size_t /*size*/, void* mem) throw()
214+
static void* operator new(std::size_t /*size*/, void* mem) noexcept
217215
{
218216
return mem;
219217
}
220-
static void operator delete(void * /*p*/, void* /*mem*/) throw()
218+
static void operator delete(void * /*p*/, void* /*mem*/) noexcept
221219
{
222220
}
223221

0 commit comments

Comments
 (0)