Add noexcept to move constructors and assignment operators.
Bug: 116614593
Test: build with WITH_TIDY=1
Change-Id: Ic97b2945ad8c77688f9df94e511a970539c06105
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index eb4368f..58afa69 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -56,7 +56,7 @@
}
// move constructor.
-hidl_handle::hidl_handle(hidl_handle &&other) {
+hidl_handle::hidl_handle(hidl_handle&& other) noexcept {
mOwnsHandle = false;
*this = std::move(other);
}
@@ -87,7 +87,7 @@
return *this;
}
-hidl_handle &hidl_handle::operator=(hidl_handle &&other) {
+hidl_handle& hidl_handle::operator=(hidl_handle&& other) noexcept {
if (this != &other) {
freeHandle();
mHandle = other.mHandle;
@@ -167,11 +167,11 @@
copyFrom(s.c_str(), s.size());
}
-hidl_string::hidl_string(hidl_string &&other): hidl_string() {
+hidl_string::hidl_string(hidl_string&& other) noexcept : hidl_string() {
moveFrom(std::forward<hidl_string>(other));
}
-hidl_string &hidl_string::operator=(hidl_string &&other) {
+hidl_string& hidl_string::operator=(hidl_string&& other) noexcept {
if (this != &other) {
clear();
moveFrom(std::forward<hidl_string>(other));