From 006586af2d3bbf3ac4f5ce36273a885b499af474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Sch=C3=B6pflin?= Date: Wed, 24 Oct 2007 09:02:32 +0000 Subject: [PATCH] Fixed code which incorrectly assumed that an iterator returned by begin() is always a modifiable lvalue. [SVN r40403] --- test/vector_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/vector_test.cpp b/test/vector_test.cpp index 84907fc..761d920 100644 --- a/test/vector_test.cpp +++ b/test/vector_test.cpp @@ -32,6 +32,7 @@ #include "dummy_test_allocator.hpp" #include #include "get_process_id_name.hpp" +#include using namespace boost::interprocess; @@ -145,8 +146,8 @@ bool do_test() 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());