diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-08-22 15:42:36 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-08-23 11:48:53 +0200 |
commit | 63dfd069b3a957361881c12ccba38c5a23b9a42f (patch) | |
tree | e7a9bd1027b19f44a7c58ea9c445ded435c838bc /sc/inc/markarr.hxx | |
parent | 61ed17cafc90d9b4303b52260f729638eed107c7 (diff) |
Mark move ctors/assignments noexcept
This should enable using move semantics where possible e.g. in standard
containers.
According to https://en.cppreference.com/w/cpp/language/move_constructor:
To make strong exception guarantee possible, user-defined move
constructors should not throw exceptions. For example, std::vector
relies on std::move_if_noexcept to choose between move and copy
when the elements need to be relocated.
Change-Id: I6e1e1cdd5cd430b139ffa2fa7031fb0bb625decb
Reviewed-on: https://gerrit.libreoffice.org/77957
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc/inc/markarr.hxx')
-rw-r--r-- | sc/inc/markarr.hxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/inc/markarr.hxx b/sc/inc/markarr.hxx index 588c26bcce49..edc1d7962d9a 100644 --- a/sc/inc/markarr.hxx +++ b/sc/inc/markarr.hxx @@ -49,7 +49,7 @@ friend class ScDocument; // for FillInfo public: ScMarkArray(); - ScMarkArray( ScMarkArray&& rArray ); + ScMarkArray( ScMarkArray&& rArray ) noexcept; ScMarkArray( const ScMarkArray& rArray ); ~ScMarkArray(); void Reset( bool bMarked = false, SCSIZE nNeeded = 1 ); @@ -62,7 +62,7 @@ public: bool HasMarks() const { return ( nCount > 1 || ( nCount == 1 && pData[0].bMarked ) ); } ScMarkArray& operator=( ScMarkArray const & rSource ); - ScMarkArray& operator=( ScMarkArray&& rSource ); + ScMarkArray& operator=(ScMarkArray&& rSource) noexcept; bool operator==(ScMarkArray const & rOther ) const; bool Search( SCROW nRow, SCSIZE& nIndex ) const; |