aboutsummaryrefslogtreecommitdiff
path: root/odb/vector-impl.ixx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-12-14 19:36:20 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-15 10:44:53 +0300
commit5fef9aadd206dce1d0faa984e66a0c3eb12154dd (patch)
tree4fad170647d74e0a590e640b2d47c0782f3a0b26 /odb/vector-impl.ixx
parent3891eb7aed225ac9f2961c953634682af6f57906 (diff)
Add noexcept to move constructors and move assignment operators
Diffstat (limited to 'odb/vector-impl.ixx')
-rw-r--r--odb/vector-impl.ixx11
1 files changed, 9 insertions, 2 deletions
diff --git a/odb/vector-impl.ixx b/odb/vector-impl.ixx
index 3377cb8..1c0ee90 100644
--- a/odb/vector-impl.ixx
+++ b/odb/vector-impl.ixx
@@ -20,7 +20,7 @@ namespace odb
#ifdef ODB_CXX11
inline vector_impl::
- vector_impl (vector_impl&& x)
+ vector_impl (vector_impl&& x) noexcept
: state_ (state_not_tracking),
size_ (0), tail_ (0), capacity_ (0), data_ (0)
{
@@ -167,12 +167,19 @@ namespace odb
#ifdef ODB_CXX11
inline vector_base::
- vector_base (vector_base&& x)
+ vector_base (vector_base&& x) noexcept
: impl_ (std::move (x.impl_)), tran_ (0)
{
if (x.tran_ != 0)
{
x.tran_->callback_unregister (&x);
+
+ // Note that _arm() can potentially throw bad_alloc while adding a new
+ // callback to the callbacks list of the transaction object. However, we
+ // assume that this will not happen since the new callback should be
+ // saved into an existing slot, freed by the above callback_unregister()
+ // call.
+ //
_arm (*x.tran_);
}
}