diff --git a/src/memchunk.h b/src/memchunk.h index 54381bee..43d2ebb9 100644 --- a/src/memchunk.h +++ b/src/memchunk.h @@ -89,14 +89,16 @@ template struct Memchunks { Memchunks(Pool *pool) : pool(pool), head(nullptr), tail(nullptr), len(0) {} Memchunks(const Memchunks &) = delete; - Memchunks(Memchunks &&other) - : pool(other.pool), head(other.head), tail(other.tail), len(other.len) { + Memchunks(Memchunks &&other) noexcept : pool(other.pool), + head(other.head), + tail(other.tail), + len(other.len) { // keep other.pool other.head = other.tail = nullptr; other.len = 0; } Memchunks &operator=(const Memchunks &) = delete; - Memchunks &operator=(Memchunks &&other) { + Memchunks &operator=(Memchunks &&other) noexcept { if (this == &other) { return *this; } @@ -253,14 +255,17 @@ template struct PeekMemchunks { : memchunks(pool), cur(nullptr), cur_pos(nullptr), cur_last(nullptr), len(0), peeking(true) {} PeekMemchunks(const PeekMemchunks &) = delete; - PeekMemchunks(PeekMemchunks &&other) - : memchunks(std::move(other.memchunks)), cur(other.cur), - cur_pos(other.cur_pos), cur_last(other.cur_last), len(other.len), + PeekMemchunks(PeekMemchunks &&other) noexcept + : memchunks(std::move(other.memchunks)), + cur(other.cur), + cur_pos(other.cur_pos), + cur_last(other.cur_last), + len(other.len), peeking(other.peeking) { other.reset(); } PeekMemchunks &operator=(const PeekMemchunks &) = delete; - PeekMemchunks &operator=(PeekMemchunks &&other) { + PeekMemchunks &operator=(PeekMemchunks &&other) noexcept { if (this == &other) { return *this; }