Added self assignement guard.

This commit is contained in:
John Wellbelove 2016-01-14 18:33:36 +00:00
parent d6a5e314e6
commit 63910abcc8

View File

@ -92,7 +92,10 @@ namespace etl
deque(const deque& other)
: ideque<T>(reinterpret_cast<T*>(&buffer[0]), MAX_SIZE, BUFFER_SIZE)
{
ideque<T>::assign(other.begin(), other.end());
if (this != &other)
{
ideque<T>::assign(other.begin(), other.end());
}
}
//*************************************************************************