mirror of
https://gitee.com/openharmony/third_party_nghttp2
synced 2024-12-11 10:07:58 +00:00
memchunk: Add noexcept
This commit is contained in:
parent
ef5d981ab1
commit
ba543e3895
@ -89,14 +89,16 @@ template <typename Memchunk> struct Memchunks {
|
||||
Memchunks(Pool<Memchunk> *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 <typename Memchunk> 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user