Код: Выделить всё
struct A{
std::list list;
std::list foo(){
return std::move(list);
}
}
A a;
// insert some elements into a.list
a.foo(); // is this guaranteed to clear a.list?
Подробнее здесь: https://stackoverflow.com/questions/601 ... d-to-leave