From bcd6a663c27390d1f76bd733e5cb5bce950cc93b Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Sun, 19 Sep 2021 14:37:50 +0100 Subject: [PATCH] BString: make move constructor and assignment noexcept Change-Id: I87f5ecad22f46b59386a091a1bb502536f460315 --- docs/user/support/String.dox | 4 ++-- headers/os/support/String.h | 4 ++-- src/kits/support/String.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/user/support/String.dox b/docs/user/support/String.dox index d39ec84a48..9fe7181e9c 100644 --- a/docs/user/support/String.dox +++ b/docs/user/support/String.dox @@ -96,7 +96,7 @@ #if __cplusplus >= 201103L /*! - \fn BString::BString(BString&& string) + \fn BString::BString(BString&& string) noexcept \brief Move the data from the \a string to this object. Create a new string object with the data of another \a string. The @@ -287,7 +287,7 @@ #if __cplusplus >= 201103L /*! - \fn BString& BString::operator=(BString&& string) + \fn BString& BString::operator=(BString&& string) noexcept \brief Move the contents of \a string to this BString object. The \a string will no longer point to the same contents. diff --git a/headers/os/support/String.h b/headers/os/support/String.h index 62ab0f3db6..806333e3e6 100644 --- a/headers/os/support/String.h +++ b/headers/os/support/String.h @@ -23,7 +23,7 @@ public: BString(const BString& string); BString(const char* string, int32 maxLength); #if __cplusplus >= 201103L - BString(BString&& string); + BString(BString&& string) noexcept; #endif ~BString(); @@ -43,7 +43,7 @@ public: BString& operator=(const char* string); BString& operator=(char c); #if __cplusplus >= 201103L - BString& operator=(BString&& string); + BString& operator=(BString&& string) noexcept; #endif BString& SetTo(const char* string); diff --git a/src/kits/support/String.cpp b/src/kits/support/String.cpp index f684e641f7..9d34a0d6e7 100644 --- a/src/kits/support/String.cpp +++ b/src/kits/support/String.cpp @@ -194,7 +194,7 @@ BString::BString(const char* string, int32 maxLength) #if __cplusplus >= 201103L -BString::BString(BString&& string) +BString::BString(BString&& string) noexcept { fPrivateData = string.fPrivateData; string.fPrivateData = NULL; @@ -273,7 +273,7 @@ BString::operator=(char c) #if __cplusplus >= 201103L BString& -BString::operator=(BString&& string) +BString::operator=(BString&& string) noexcept { if (this != &string) { _ReleasePrivateData();