mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-19 02:16:55 +08:00
Added self assignement guard.
This commit is contained in:
parent
d6a5e314e6
commit
63910abcc8
5
deque.h
5
deque.h
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user