[vector] Destruct in pop()
This commit is contained in:
parent
7171917b52
commit
5946e945d5
|
@ -325,8 +325,10 @@ struct hb_vector_t
|
||||||
Type pop ()
|
Type pop ()
|
||||||
{
|
{
|
||||||
if (!length) return Null (Type);
|
if (!length) return Null (Type);
|
||||||
return std::move (arrayZ[--length]); /* Does this move actually work? */
|
Type v = std::move (arrayZ[length - 1]);
|
||||||
// XXX Destruct?
|
arrayZ[length - 1].~Type ();
|
||||||
|
length--;
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void remove (unsigned int i)
|
void remove (unsigned int i)
|
||||||
|
|
Loading…
Reference in New Issue