[clang-tidy] Add noexcept where move is used

Found with performance-noexcept-move-constructor

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2019-11-07 12:56:09 -08:00 committed by Victor Zverovich
parent e6e8298904
commit bb0c8bfea8
2 changed files with 4 additions and 4 deletions

View File

@ -607,14 +607,14 @@ class basic_memory_buffer : private Allocator, public internal::buffer<T> {
of the other object to it. of the other object to it.
\endrst \endrst
*/ */
basic_memory_buffer(basic_memory_buffer&& other) { move(other); } basic_memory_buffer(basic_memory_buffer&& other) FMT_NOEXCEPT { move(other); }
/** /**
\rst \rst
Moves the content of the other ``basic_memory_buffer`` object to this one. Moves the content of the other ``basic_memory_buffer`` object to this one.
\endrst \endrst
*/ */
basic_memory_buffer& operator=(basic_memory_buffer&& other) { basic_memory_buffer& operator=(basic_memory_buffer&& other) FMT_NOEXCEPT {
assert(this != &other); assert(this != &other);
deallocate(); deallocate();
move(other); move(other);

View File

@ -146,7 +146,7 @@ class buffered_file {
other.file_ = nullptr; other.file_ = nullptr;
} }
buffered_file& operator=(buffered_file&& other) { buffered_file& operator=(buffered_file&& other) FMT_NOEXCEPT {
close(); close();
file_ = other.file_; file_ = other.file_;
other.file_ = nullptr; other.file_ = nullptr;
@ -209,7 +209,7 @@ class file {
file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; } file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; }
file& operator=(file&& other) { file& operator=(file&& other) FMT_NOEXCEPT {
close(); close();
fd_ = other.fd_; fd_ = other.fd_;
other.fd_ = -1; other.fd_ = -1;