From: Alberto Barbati (abarbati_at_[hidden])
Date: 2004-03-08 09:17:02
David Abrahams wrote:
> Alberto Barbati <abarbati_at_[hidden]> writes:
>>Problem is that there is something wrong with the implementation of
>>operator in iterator_facade and the regression test does not compile
> What makes you say that there's something wrong with iterator_facade's
> operator? Is it possible that the regression test makes invalid
> assumptions about the way an iterator's operator is supposed to work?
The problem is triggered by the expression
BOOST_CHECK(it == 2);
found in file base_test.cpp line 157. VC .NET 2003 gives the following
error C2678: binary '==' : no operator found which takes a left-hand
operand of type
(or there is no acceptable conversion)
"it" is defined as circular_buffer<Integer>::iterator. As the right hand
side is not an "Integer" I also tried writing:
BOOST_CHECK(it == Integer(2));
but the error message stays the same.
>>However, if I hack iterator_facade::operator to avoid
>>the use of the operator_brackets_proxy class
> That's unneccessary. Any iterator_facade behavior you want to replace
> can simply be added to your derived iterator class.
Yes. Sure you are right. I feel kind of stupid, I should have thought
about it in the first place.
I am uploading a revised version of circular_buffer_new_iterators_v2.zip
that overrides operator. All regression tests passes with VC7.1. I
also made the implementation members private and fixed the comments.
Anyway you'll agree that the issue is quite general and it might be
interesting to investigate if we could find a solution at the
>>all regression tests pass. Maybe it would be good to discuss this
>>problem of the iterator_facade in a different thread.
> Here we are!
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk