diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-12-09 20:00:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-12-13 14:50:13 +0300 |
commit | c6c224a78715d5e2c532fe318325fbca8e70e701 (patch) | |
tree | dc755313aa482f62ebac15ade66c41a24e908d86 /libbutl/move-only-function.hxx | |
parent | 8cc86445437e7afc583dee18b36c0e8ba4b6fe12 (diff) |
Add noexcept to move constructors and move assignment operators
Diffstat (limited to 'libbutl/move-only-function.hxx')
-rw-r--r-- | libbutl/move-only-function.hxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libbutl/move-only-function.hxx b/libbutl/move-only-function.hxx index 846ef25..e5cfe51 100644 --- a/libbutl/move-only-function.hxx +++ b/libbutl/move-only-function.hxx @@ -124,7 +124,10 @@ namespace butl return f (std::forward<A> (args)...); } - wrapper (wrapper&& w): f (std::move (w.f)) {} + wrapper (wrapper&& w) + noexcept (std::is_nothrow_move_constructible<F>::value) + : f (std::move (w.f)) {} + wrapper& operator= (wrapper&&) = delete; // Shouldn't be needed. ~wrapper () {f.~F ();} |