$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r71388 - sandbox/shifted_ptr/boost
From: phil_at_[hidden]
Date: 2011-04-20 01:15:39
Author: pbouchard
Date: 2011-04-20 01:15:38 EDT (Wed, 20 Apr 2011)
New Revision: 71388
URL: http://svn.boost.org/trac/boost/changeset/71388
Log:
* Code cleanup
Text files modified: 
   sandbox/shifted_ptr/boost/shifted_ptr.hpp |    19 ++++++++++++++-----                     
   1 files changed, 14 insertions(+), 5 deletions(-)
Modified: sandbox/shifted_ptr/boost/shifted_ptr.hpp
==============================================================================
--- sandbox/shifted_ptr/boost/shifted_ptr.hpp	(original)
+++ sandbox/shifted_ptr/boost/shifted_ptr.hpp	2011-04-20 01:15:38 EDT (Wed, 20 Apr 2011)
@@ -100,9 +100,12 @@
                 delete &* i;
             }
                 
-            for (intrusive_list::iterator<set, & set::tag_> i = p->includes_.begin(), j; j = i, ++ j, i != p->includes_.end(); i = j)
+            for (intrusive_list::iterator<set, & set::tag_> i = p->includes_.begin(), j; j = i, i != p->includes_.end(); i = j)
+			{ 
+				++ j;
                 if (&* i != this && &* i != p)
                     delete &* i;
+			}
                     
             if (p != this)
                 delete p;
@@ -406,12 +409,18 @@
             if (p->init_)
                 return;
         
-            for (intrusive_list::iterator<owned_base, & owned_base::init_tag_> i = p->inits_.begin(), j; j = i, ++ j, i != p->inits_.end(); i = j)
+			// iterate memory blocks
+            for (intrusive_list::iterator<owned_base, & owned_base::init_tag_> i = p->inits_.begin(); i != p->inits_.end(); ++ i)
             {
                 ps_->elements()->push_back(& i->set_tag_);
-                
-                for (intrusive_stack::iterator<shifted_ptr, & shifted_ptr::pn_> m = i->ptrs_.begin(), n; n = m, ++ n, m != i->ptrs_.end(); m = n)
-                    m->ps_ = ps_;
+
+				// iterate shifted_ptr elements
+                for (intrusive_stack::iterator<shifted_ptr, & shifted_ptr::pn_> j = i->ptrs_.begin(), k; k = j, j != i->ptrs_.end(); j = k)
+				{
+					++ k;
+					
+                    j->ps_ = ps_;
+				}
             }
             
             p->init_ = true;