Boost logo

Boost-Commit :

From: markus.schoepflin_at_[hidden]
Date: 2007-10-24 05:02:32


Author: schoepflin
Date: 2007-10-24 05:02:32 EDT (Wed, 24 Oct 2007)
New Revision: 40403
URL: http://svn.boost.org/trac/boost/changeset/40403

Log:
Fixed code which incorrectly assumed that an iterator returned by begin() is
always a modifiable lvalue.

Text files modified:
   trunk/libs/interprocess/test/vector_test.cpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: trunk/libs/interprocess/test/vector_test.cpp
==============================================================================
--- trunk/libs/interprocess/test/vector_test.cpp (original)
+++ trunk/libs/interprocess/test/vector_test.cpp 2007-10-24 05:02:32 EDT (Wed, 24 Oct 2007)
@@ -32,6 +32,7 @@
 #include "dummy_test_allocator.hpp"
 #include <string>
 #include "get_process_id_name.hpp"
+#include <boost/utility.hpp>
 
 using namespace boost::interprocess;
 
@@ -145,8 +146,8 @@
          typename MyShmVector::iterator it;
          typename MyShmVector::const_iterator cit = it;
 
- shmvector->erase(shmvector->begin()++);
- stdvector->erase(stdvector->begin()++);
+ shmvector->erase(boost::next(shmvector->begin()));
+ stdvector->erase(boost::next(stdvector->begin()));
          if(!test::CheckEqualContainers(shmvector, stdvector)) return false;
 
          shmvector->erase(shmvector->begin());


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