From 6b3c83ce50e92068f428f284fbdf86c4328a1bd3 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 6 Aug 2021 16:48:07 +0300 Subject: Fix small_vector(small_vector&&) to clear object it moves from --- libbutl/small-vector.mxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libbutl') 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& -- cgit v1.1