Fix swap(). The previous swap() is no longer correct now that data is a std::list.
Specifically the list::end() iterator gets invalidated.