id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2862,slist::swap is broken when cache_last< true > is used,Andrey Semashev,Ion Gaztañaga,"Swapping two slists with the cache_last option yields an invalid slist. The following code snippet demonstrates the problem: {{{ #include #include #include #include #include namespace bi = boost::intrusive; typedef bi::slist_base_hook< bi::link_mode< bi::safe_link > > BaseHook_t; struct MyData : public BaseHook_t { int m_Data; explicit MyData(int d) : m_Data(d) {} }; int main(int, char*[]) { typedef bi::slist< MyData, bi::base_hook< BaseHook_t >, bi::constant_time_size< true >, bi::cache_last< true > > List_t; List_t l1; MyData* p = 0; p = new MyData(1); l1.push_back(*p); p = new MyData(2); l1.push_back(*p); p = new MyData(3); l1.push_back(*p); p = new MyData(4); l1.push_back(*p); std::cout << ""l1.front() = "" << &l1.front() << std::endl; List_t l2; l2.swap(l1); std::cout << ""l2.front() = "" << &l2.front() << std::endl; // should be the same as l1.front() above l2.clear_and_dispose(boost::checked_deleter< MyData >()); // this line crashes return 0; } }}} ",Bugs,closed,Boost 1.39.0,intrusive,Boost 1.38.0,Showstopper,fixed,slist swap,