[vector] Implement move assignment using swap

This commit is contained in:
Behdad Esfahbod 2021-11-01 20:06:58 -06:00
parent eeda2c549d
commit 18a078f968
1 changed files with 1 additions and 5 deletions

View File

@ -110,11 +110,7 @@ struct hb_vector_t
} }
hb_vector_t& operator = (hb_vector_t &&o) hb_vector_t& operator = (hb_vector_t &&o)
{ {
fini (); hb_swap (*this, o);
allocated = o.allocated;
length = o.length;
arrayZ = o.arrayZ;
o.init ();
return *this; return *this;
} }