Boost logo

Boost-Commit :

From: igaztanaga_at_[hidden]
Date: 2008-05-19 16:46:22


Author: igaztanaga
Date: 2008-05-19 16:46:22 EDT (Mon, 19 May 2008)
New Revision: 45565
URL: http://svn.boost.org/trac/boost/changeset/45565

Log:
x's cache_last was not updated when splicing the whole container
Text files modified:
   trunk/boost/intrusive/slist.hpp | 7 +++++--
   1 files changed, 5 insertions(+), 2 deletions(-)

Modified: trunk/boost/intrusive/slist.hpp
==============================================================================
--- trunk/boost/intrusive/slist.hpp (original)
+++ trunk/boost/intrusive/slist.hpp 2008-05-19 16:46:22 EDT (Mon, 19 May 2008)
@@ -1015,8 +1015,11 @@
          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());


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk