bug in boost::container ??

Hi, the attached example confuses me, I've got: $ g++ -Wall boost_container_bug.cpp -o boost_container_bug && ./boost_container_bug (size=4 [1, 2, 3, 4, 0, 4]) $ LANG=en g++ --version g++ (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Did I miss something or is it a bug? Thanks, Olaf

On Thu, Apr 18, 2013 at 10:20 AM, Olaf Peter
Hi,
the attached example confuses me, I've got:
$ g++ -Wall boost_container_bug.cpp -o boost_container_bug && ./boost_container_bug (size=4 [1, 2, 3, 4, 0, 4])
$ LANG=en g++ --version g++ (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Did I miss something or is it a bug?
Works as expected with Boost 1.49 and GCC 4.7: $ ./a.out (size=4 [1, 2, 3, 4]) $ g++ --version g++ (Ubuntu/Linaro 4.7.2-5ubuntu1) 4.7.2 -kyle

2013/4/18 Olaf Peter
Hi,
the attached example confuses me, I've got:
$ g++ -Wall boost_container_bug.cpp -o boost_container_bug && ./boost_container_bug (size=4 [1, 2, 3, 4, 0, 4])
On MSVC11 with boost 1.53 outputs: (size=4 [1, 2, 3, 4]) What version of boost are you using? -- Best regards, Antony Polukhin

On 18 April 2013 15:36, Antony Polukhin
2013/4/18 Olaf Peter
: Hi,
the attached example confuses me, I've got:
$ g++ -Wall boost_container_bug.cpp -o boost_container_bug && ./boost_container_bug (size=4 [1, 2, 3, 4, 0, 4])
On MSVC11 with boost 1.53 outputs: (size=4 [1, 2, 3, 4])
What version of boost are you using?
The bug is in trunk. See the definition of operator- in: https://svn.boost.org/trac/boost/changeset/83126/trunk/boost/container/vecto... Should be trivial to fix. A workaround is to use "end() + (-1)" instead of "end() - 1".

Am 18.04.2013 16:45, schrieb Daniel James:
On 18 April 2013 15:36, Antony Polukhin
wrote: 2013/4/18 Olaf Peter
: Hi,
the attached example confuses me, I've got:
$ g++ -Wall boost_container_bug.cpp -o boost_container_bug && ./boost_container_bug (size=4 [1, 2, 3, 4, 0, 4])
On MSVC11 with boost 1.53 outputs: (size=4 [1, 2, 3, 4])
What version of boost are you using?
The bug is in trunk. See the definition of operator- in:
https://svn.boost.org/trac/boost/changeset/83126/trunk/boost/container/vecto...
Should be trivial to fix. A workaround is to use "end() + (-1)" instead of "end() - 1".
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
oh yes, I'm sorry; I forgot to mention $ LANG=en svn info Path: . URL: http://svn.boost.org/svn/boost/trunk Repository Root: http://svn.boost.org/svn/boost Repository UUID: b8fc166d-592f-0410-95f2-cb63ce0dd405 Revision: 83478 Node Kind: directory Schedule: normal Last Changed Author: barendgehrels Last Changed Rev: 83478 Last Changed Date: 2013-03-17 18:20:47 +0100 (Sun, 17 Mar 2013) $ svn info Pfad: . URL: http://svn.boost.org/svn/boost/trunk Basis des Projektarchivs: http://svn.boost.org/svn/boost UUID des Projektarchivs: b8fc166d-592f-0410-95f2-cb63ce0dd405 Revision: 83478 Knotentyp: Verzeichnis Plan: normal Letzter Autor: barendgehrels Letzte geänderte Rev: 83478 Letztes Änderungsdatum: 2013-03-17 18:20:47 +0100 (So, 17. Mär 2013)

Hi, I tried it and got output: (size=4 [1, 2, 3, 4]) gcc-4.8 Mac OS X 10.7.5 -- View this message in context: http://boost.2283326.n4.nabble.com/bug-in-boost-container-tp4645578p4645581.... Sent from the Boost - Dev mailing list archive at Nabble.com.
participants (6)
-
Antony Polukhin
-
Daniel James
-
Dmitriy Gorbel
-
Ion Gaztañaga
-
Kyle Lutz
-
Olaf Peter