summaryrefslogtreecommitdiff
path: root/include/connectivity
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 /include/connectivity
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 'include/connectivity')
-rw-r--r--include/connectivity/FValue.hxx8
-rw-r--r--include/connectivity/dbmetadata.hxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/include/connectivity/FValue.hxx b/include/connectivity/FValue.hxx
index e79ef73f0a13..c9f9c86cbb0b 100644
--- a/include/connectivity/FValue.hxx
+++ b/include/connectivity/FValue.hxx
@@ -74,7 +74,7 @@ namespace connectivity
bool m_bModified : 1; // value was changed
bool m_bSigned : 1; // value is signed
- void free();
+ void free() noexcept;
public:
ORowSetValue()
@@ -98,7 +98,7 @@ namespace connectivity
operator=(_rRH);
}
- ORowSetValue(ORowSetValue&& _rRH)
+ ORowSetValue(ORowSetValue&& _rRH) noexcept
:m_eTypeKind(css::sdbc::DataType::VARCHAR)
,m_bNull(true)
,m_bBound(true)
@@ -106,7 +106,7 @@ namespace connectivity
,m_bSigned(true)
{
m_aValue.m_pString = nullptr;
- operator=(_rRH);
+ operator=(std::move(_rRH));
}
ORowSetValue(const OUString& _rRH)
@@ -279,7 +279,7 @@ namespace connectivity
}
ORowSetValue& operator=(const ORowSetValue& _rRH);
- ORowSetValue& operator=(ORowSetValue&& _rRH);
+ ORowSetValue& operator=(ORowSetValue&& _rRH) noexcept;
// simple types
ORowSetValue& operator=(bool _rRH);
diff --git a/include/connectivity/dbmetadata.hxx b/include/connectivity/dbmetadata.hxx
index 085b30b52875..17a392dfe568 100644
--- a/include/connectivity/dbmetadata.hxx
+++ b/include/connectivity/dbmetadata.hxx
@@ -72,8 +72,8 @@ namespace dbtools
const css::uno::Reference< css::sdbc::XConnection >& _connection );
DatabaseMetaData( const DatabaseMetaData& _copyFrom );
DatabaseMetaData& operator=( const DatabaseMetaData& _copyFrom );
- DatabaseMetaData( DatabaseMetaData&& _copyFrom );
- DatabaseMetaData& operator=( DatabaseMetaData&& _copyFrom );
+ DatabaseMetaData(DatabaseMetaData&& _copyFrom) noexcept;
+ DatabaseMetaData& operator=(DatabaseMetaData&& _copyFrom) noexcept;
~DatabaseMetaData();