diff --git a/list.h b/list.h index d1cb6eed..a6859b6a 100644 --- a/list.h +++ b/list.h @@ -92,10 +92,10 @@ namespace etl //************************************************************************* /// Copy constructor. //************************************************************************* - explicit list(const list& other) + list(const list& other) : ilist(node_pool, MAX_SIZE) { - ilist::assign(other.cbegin(), other.cend()); + ilist::assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -113,7 +113,10 @@ namespace etl //************************************************************************* list& operator = (const list& rhs) { - ilist::assign(rhs.cbegin(), rhs.cend()); + if (&rhs != this) + { + ilist::assign(rhs.cbegin(), rhs.cend()); + } return *this; }