summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-08-22 15:42:36 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-08-23 11:48:53 +0200
commit63dfd069b3a957361881c12ccba38c5a23b9a42f (patch)
treee7a9bd1027b19f44a7c58ea9c445ded435c838bc /l10ntools
parent61ed17cafc90d9b4303b52260f729638eed107c7 (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 'l10ntools')
-rw-r--r--l10ntools/inc/po.hxx2
-rw-r--r--l10ntools/source/po.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index aff8b88af100..bbbf289cbec6 100644
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -51,7 +51,7 @@ public:
PoEntry( const PoEntry& rPo );
PoEntry& operator=( const PoEntry& rPo );
- PoEntry& operator=( PoEntry&& rPo );
+ PoEntry& operator=( PoEntry&& rPo ) noexcept;
OString const & getSourceFile() const; ///< Get name of file from which entry is extracted
OString getGroupId() const;
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 921d752ce6c7..20c728e6338c 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -322,7 +322,7 @@ PoEntry& PoEntry::operator=(const PoEntry& rPo)
return *this;
}
-PoEntry& PoEntry::operator=(PoEntry&& rPo)
+PoEntry& PoEntry::operator=(PoEntry&& rPo) noexcept
{
m_pGenPo = std::move(rPo.m_pGenPo);
m_bIsInitialized = std::move(rPo.m_bIsInitialized);