diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/include/android-base/scopeguard.h | 2 | ||||
-rw-r--r-- | base/include/android-base/unique_fd.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/base/include/android-base/scopeguard.h b/base/include/android-base/scopeguard.h index e6a9d109d..5a224d634 100644 --- a/base/include/android-base/scopeguard.h +++ b/base/include/android-base/scopeguard.h @@ -28,7 +28,7 @@ class ScopeGuard { public: ScopeGuard(F&& f) : f_(std::forward<F>(f)), active_(true) {} - ScopeGuard(ScopeGuard&& that) : f_(std::move(that.f_)), active_(that.active_) { + ScopeGuard(ScopeGuard&& that) noexcept : f_(std::move(that.f_)), active_(that.active_) { that.active_ = false; } diff --git a/base/include/android-base/unique_fd.h b/base/include/android-base/unique_fd.h index 71025adc2..cd2dc0416 100644 --- a/base/include/android-base/unique_fd.h +++ b/base/include/android-base/unique_fd.h @@ -90,8 +90,8 @@ class unique_fd_impl final { explicit unique_fd_impl(int fd) { reset(fd); } ~unique_fd_impl() { reset(); } - unique_fd_impl(unique_fd_impl&& other) { reset(other.release()); } - unique_fd_impl& operator=(unique_fd_impl&& s) { + unique_fd_impl(unique_fd_impl&& other) noexcept { reset(other.release()); } + unique_fd_impl& operator=(unique_fd_impl&& s) noexcept { int fd = s.fd_; s.fd_ = -1; reset(fd, &s); |