
At 12:56 PM 8/11/2004, Martin Wille wrote:
Hello,
a momemnt ago, someone reported a problem on IRC regarding boost::filesystem::path::iterator. He basically has code like this:
using boost::filesystem::path; path::iterator i = somepath.begin(); path::iterator j = i++;
That code used to work but stopped working recently. Now, there is a compiler error saying that the value returned by i++ is not suitable for constructing j:
error: conversion from ` boost::detail::postfix_increment_proxy<boost::filesystem::path::iterator>' to non-scalar type `boost::filesystem::path::iterator' requested
I suspect the change was caused by a recent change to iterator adaptors.
Investigation of the problem revealed that the documenation for path::iterator says it is a bidirectional iterator while the implementation uses single_pass_traversal_tag. This looks wrong to me.
I agree with your analysis. What is weird is that even though the single_pass_traversal_tag is given, the path_test.cpp regression test uses operator-- in tests, and they compile fine. So it looks like there is also a bug in iterator adaptors too, since I would think that the use of operator-- on a single pass iterator should fail. Thanks, --Beman