Make buffered_file move assignment noexcept

This commit is contained in:
Jerry Crunchtime 2021-12-12 14:07:13 +01:00
parent 3a951a66cb
commit 5863d7f067

View File

@ -247,10 +247,8 @@ class buffered_file {
other.file_ = nullptr; other.file_ = nullptr;
} }
buffered_file& operator=(buffered_file&& other) { buffered_file& operator=(buffered_file&& other) FMT_NOEXCEPT {
close(); std::swap(file_, other.file_);
file_ = other.file_;
other.file_ = nullptr;
return *this; return *this;
} }