Re: [boost] [iterator] Help needed understanding output_iterator requirements

Dear authors of Boost.Iterator, As described in <http://lists.boost.org/Archives/boost/2010/03/163133.php>, Boost.MultiArray is currently unusable with the recently released MSVC 10. This is also confirmed by many failures in the regression tests: <http://www.boost.org/development/tests/release/developer/multi_array.html>. These failures are caused by a specific behavior of iterator_facade from Boost.Iterator, introduced by Jeremy Siek with the explanation "changed iterator_facade_default_category to stop lying about output_iterator_tag": <https://svn.boost.org/trac/boost/changeset/21683>. I'm not the right person to judge (or understand) how serious the original code was a lying, but the attached patch that conditionally reintroduces the original behavior as a workaround for MSVC 10 fixes all compile failures of the regression tests of Boost.MultiArray for me (MSVC 10 does compile time checking of iterator categories when _HAS_ITERATOR_DEBUGGING is defined). However, the "resize" regression test then fails with a runtime error (assertion failure) instead of a compile error: testing.capture-output ..\..\..\bin.v2\libs\multi_array\test\resize.test\msvc-10.0\debug\threading-multi\resize.run ====== BEGIN OUTPUT ====== Assertion failed: index_bases[n] <= start && start < index_bases[n]+index(extents[n]), file C:\nobackup\boost_trunk\boost/multi_array/base.hpp, line 446 C:\nobackup\boost_trunk\boost/test/minimal.hpp(123): exception "R6010 - abort() has been called " caught in function: 'int __cdecl main(int,char *[])' **** Testing aborted. **** 1 error detected EXIT STATUS: 201 ====== END OUTPUT ====== I have no idea whether this failure is related to the reintroduced lying or not. All I know is that there have been recent request to find "some kind of proper workaround or fix" for these issues: <http://lists.boost.org/Archives/boost/2010/04/165548.php>. But from my point of view, the only responsibility I may have with respect to these issues is to notify the authors of the affected libraries, which I have done now. Regards, Thomas

Hi, I neither have access to VC 10 nor to the sources right now, but looking at the messages Boost.MultiArray simply uses iterator_facade incorrectly. The problem is not in Jeremy's patch it is in MultiArray not making sure that the facade based iterator supports output. HTH Thomas On May 1, 2010, at 5:50 PM, Thomas Klimpel wrote:
Dear authors of Boost.Iterator,
As described in <http://lists.boost.org/Archives/boost/2010/03/163133.php>, Boost.MultiArray is currently unusable with the recently released MSVC 10. This is also confirmed by many failures in the regression tests: <http://www.boost.org/development/tests/release/developer/multi_array.html>.
These failures are caused by a specific behavior of iterator_facade from Boost.Iterator, introduced by Jeremy Siek with the explanation "changed iterator_facade_default_category to stop lying about output_iterator_tag": <https://svn.boost.org/trac/boost/changeset/21683>.
I'm not the right person to judge (or understand) how serious the original code was a lying, but the attached patch that conditionally reintroduces the original behavior as a workaround for MSVC 10 fixes all compile failures of the regression tests of Boost.MultiArray for me (MSVC 10 does compile time checking of iterator categories when _HAS_ITERATOR_DEBUGGING is defined). However, the "resize" regression test then fails with a runtime error (assertion failure) instead of a compile error:
testing.capture-output ..\..\..\bin.v2\libs\multi_array\test\resize.test\msvc-10.0\debug\threading-multi\resize.run ====== BEGIN OUTPUT ====== Assertion failed: index_bases[n] <= start && start < index_bases[n]+index(extents[n]), file C:\nobackup\boost_trunk\boost/multi_array/base.hpp, line 446 C:\nobackup\boost_trunk\boost/test/minimal.hpp(123): exception "R6010 - abort() has been called " caught in function: 'int __cdecl main(int,char *[])'
**** Testing aborted. **** 1 error detected
EXIT STATUS: 201 ====== END OUTPUT ======
I have no idea whether this failure is related to the reintroduced lying or not. All I know is that there have been recent request to find "some kind of proper workaround or fix" for these issues: <http://lists.boost.org/Archives/boost/2010/04/165548.php>. But from my point of view, the only responsibility I may have with respect to these issues is to notify the authors of the affected libraries, which I have done now.
Regards, Thomas <facade_iterator_category.patch>
-- Thomas Witt Zephyr Associates, Inc. witt@styleadvisor.com

Hi, thanks for looking at this.
The problem is not in Jeremy's patch it is in MultiArray not making sure that the facade based iterator supports output.
Perhaps, but Jeremy's patch prevents that any proxy based iterator can be an output_iterator. This is why I'm asking for help understanding the output_iterator requirements. I don't think that MultiArray has any chance of avoiding the proxy. What also strikes me as odd about Jeremy's patch is that it makes "iterator_writability_disabled" completly unused, yet doesn't removes it or updates the documentation of iterator_facade_default_category. Regards, Thomas

Thomas Klimpel wrote:
However, the "resize" regression test then fails with a runtime error (assertion failure) instead of a compile error: [snip] I have no idea whether this failure is related to the reintroduced lying or not.
It's unrelated to the reintroduced lying, as explained in <http://lists.boost.org/Archives/boost/2010/05/165810.php>. Regards, Thomas
participants (2)
-
Thomas Klimpel
-
Thomas Witt