Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57342 - sandbox/committee/rvalue_ref
From: dave_at_[hidden]
Date: 2009-11-03 14:36:54


Author: dave
Date: 2009-11-03 14:36:54 EST (Tue, 03 Nov 2009)
New Revision: 57342
URL: http://svn.boost.org/trac/boost/changeset/57342

Log:
fix off-by-1 error (thanks, Sebastian!)
Text files modified:
   sandbox/committee/rvalue_ref/N2983-throwing-move.rst | 4 ++--
   sandbox/committee/rvalue_ref/N2983.html | 4 ++--
   2 files changed, 4 insertions(+), 4 deletions(-)

Modified: sandbox/committee/rvalue_ref/N2983-throwing-move.rst
==============================================================================
--- sandbox/committee/rvalue_ref/N2983-throwing-move.rst (original)
+++ sandbox/committee/rvalue_ref/N2983-throwing-move.rst 2009-11-03 14:36:54 EST (Tue, 03 Nov 2009)
@@ -122,8 +122,8 @@
           }
           catch(...)
           {
- for (;i > 0; --i) // clean up new elements
- (new_begin + i)->~value_type();
+ while (i > 0) // clean up new elements
+ (new_begin + --i)->~value_type();
 
               this->deallocate( new_begin ); // release storage
               throw;

Modified: sandbox/committee/rvalue_ref/N2983.html
==============================================================================
--- sandbox/committee/rvalue_ref/N2983.html (original)
+++ sandbox/committee/rvalue_ref/N2983.html 2009-11-03 14:36:54 EST (Tue, 03 Nov 2009)
@@ -454,8 +454,8 @@
         }
         catch(...)
         {
- for (;i > 0; --i) // clean up new elements
- (new_begin + i)->~value_type();
+ while (i > 0) // clean up new elements
+ (new_begin + --i)->~value_type();
 
             this->deallocate( new_begin ); // release storage
             throw;


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