middle-end/97207 - implement move assign for auto_vec<>

This implements the missing move assignment to make std::swap work
on auto_vec<>

2020-09-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/97207
	* vec.h (auto_vec<T>::operator=(auto_vec<T>&&)): Implement.
This commit is contained in:
Richard Biener 2020-09-25 13:59:15 +02:00
parent 473da7e22c
commit 7bfc4cd2c8

View File

@ -1546,7 +1546,13 @@ public:
this->m_vec = r.m_vec;
r.m_vec = NULL;
}
void operator= (auto_vec&&) = delete;
auto_vec& operator= (auto_vec&& r)
{
this->release ();
this->m_vec = r.m_vec;
r.m_vec = NULL;
return *this;
}
};