aboutsummaryrefslogtreecommitdiff
path: root/libbutl/small-forward-list.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-12-09 20:00:08 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-12-13 14:50:13 +0300
commitc6c224a78715d5e2c532fe318325fbca8e70e701 (patch)
treedc755313aa482f62ebac15ade66c41a24e908d86 /libbutl/small-forward-list.hxx
parent8cc86445437e7afc583dee18b36c0e8ba4b6fe12 (diff)
Add noexcept to move constructors and move assignment operators
Diffstat (limited to 'libbutl/small-forward-list.hxx')
-rw-r--r--libbutl/small-forward-list.hxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbutl/small-forward-list.hxx b/libbutl/small-forward-list.hxx
index 1278dc2..8d1cf68 100644
--- a/libbutl/small-forward-list.hxx
+++ b/libbutl/small-forward-list.hxx
@@ -5,6 +5,7 @@
#include <cstddef> // size_t
#include <utility> // move()
+#include <type_traits> // is_nothrow_move_constructible
#include <forward_list>
#include <libbutl/small-allocator.hxx>
@@ -101,14 +102,20 @@ namespace butl
return *this;
}
+ // See small_vector for the move-constructor/assignment noexept
+ // expressions reasoning.
+ //
small_forward_list (small_forward_list&& v)
+#if !defined(_MSC_VER) || _MSC_VER > 1900
+ noexcept (std::is_nothrow_move_constructible<T>::value)
+#endif
: base_type (allocator_type (this))
{
*this = std::move (v); // Delegate to operator=(&&).
}
small_forward_list&
- operator= (small_forward_list&& v)
+ operator= (small_forward_list&& v) noexcept (false)
{
// VC14's implementation of operator=(&&) swaps pointers without regard
// for allocator (fixed in 15).