mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
[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:
parent
e6e8298904
commit
bb0c8bfea8
@ -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);
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user