From 377a4f8a0bee52eeac56efee0d72ee9feac3eaf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 19 May 2008 20:46:22 +0000 Subject: [PATCH] x's cache_last was not updated when splicing the whole container [SVN r45565] --- include/boost/intrusive/slist.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/boost/intrusive/slist.hpp b/include/boost/intrusive/slist.hpp index 5a264e4..3527bfe 100644 --- a/include/boost/intrusive/slist.hpp +++ b/include/boost/intrusive/slist.hpp @@ -1015,8 +1015,11 @@ class slist_impl iterator last_x(x.previous(x.end())); //<- constant time if cache_last is active node_ptr prev_n(prev.pointed_node()); node_ptr last_x_n(last_x.pointed_node()); - if(cache_last && node_traits::get_next(prev_n) == this->get_end_node()){ - this->set_last_node(last_x_n); + if(cache_last){ + x.set_last_node(x.get_root_node()); + if(node_traits::get_next(prev_n) == this->get_end_node()){ + this->set_last_node(last_x_n); + } } node_algorithms::transfer_after( prev_n, x.before_begin().pointed_node(), last_x_n); this->priv_size_traits().set_size(this->priv_size_traits().get_size() + x.priv_size_traits().get_size());