diff --git a/core/templates/list.h b/core/templates/list.h index 02afeec74dee..14dd0adaede5 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -522,6 +522,15 @@ class List { it = it->next(); } } + void operator=(List &&p_list) { + if (unlikely(this == &p_list)) { + return; + } + + clear(); + _data = p_list._data; + p_list._data = nullptr; + } // Random access to elements, use with care, // do not use for iteration. @@ -760,6 +769,10 @@ class List { it = it->next(); } } + List(List &&p_list) { + _data = p_list._data; + p_list._data = nullptr; + } List() {}