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/source/core/data/cellvalue.cxx | |
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/source/core/data/cellvalue.cxx')
-rw-r--r-- | sc/source/core/data/cellvalue.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx index ef662c4818f7..a860b359ee1d 100644 --- a/sc/source/core/data/cellvalue.cxx +++ b/sc/source/core/data/cellvalue.cxx @@ -244,7 +244,7 @@ ScCellValue::ScCellValue( const ScCellValue& r ) : meType(r.meType), mfValue(r.m } } -ScCellValue::ScCellValue(ScCellValue&& r) +ScCellValue::ScCellValue(ScCellValue&& r) noexcept : meType(r.meType) , mfValue(r.mfValue) { @@ -270,7 +270,7 @@ ScCellValue::~ScCellValue() clear(); } -void ScCellValue::clear() +void ScCellValue::clear() noexcept { switch (meType) { @@ -513,7 +513,7 @@ ScCellValue& ScCellValue::operator= ( const ScCellValue& r ) return *this; } -ScCellValue& ScCellValue::operator=(ScCellValue&& rCell) +ScCellValue& ScCellValue::operator=(ScCellValue&& rCell) noexcept { clear(); |