aboutsummaryrefslogtreecommitdiff
path: root/libbutl
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-08-06 16:48:07 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-08-06 17:40:19 +0300
commit6b3c83ce50e92068f428f284fbdf86c4328a1bd3 (patch)
treede10ee768f7eb3d589e3b4e7f10b00fcaf3737da /libbutl
parent7ebd5f9f540e907de06d8fdc76d95ccacabbbe1f (diff)
Fix small_vector(small_vector&&) to clear object it moves from
Diffstat (limited to 'libbutl')
-rw-r--r--libbutl/small-vector.mxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbutl/small-vector.mxx b/libbutl/small-vector.mxx
index 2a92182..7f9bb1e 100644
--- a/libbutl/small-vector.mxx
+++ b/libbutl/small-vector.mxx
@@ -125,6 +125,11 @@ LIBBUTL_MODEXPORT namespace butl
reserve ();
*this = std::move (v); // Delegate to operator=(&&).
+
+ // Note that in contrast to the move assignment operator, the
+ // constructor must clear the other vector.
+ //
+ v.clear ();
}
small_vector&