iter_swapping vector<bool>::iterator..

Paolo Carlini pcarlini@suse.de
Fri Mar 18 16:38:00 GMT 2005


Chris Jefferson wrote:

> (Just thought I'd answer this bit.. but please answer if you have any
> knowledge in this area, the whole iterator / vector<bool> / swap
> business just confuses me..)
>
> I don't think we can fix this with the implementation, looking at
> 23.2.5, the "reference" type has to be a class rather than a reference,
> defined like:

[snip]

Ok, thanks, personally I'm becoming convinced that indeed we can't.

> If this seems reasonable, I'll neaten it up / add a whole bunch of
> testcases to make sure nothing is broken, etc :)

In my opinion, *if* we agree that vector<bool>::iterator cannot be
implemented to meet the requirements of forward iterator, there is
no point in adding these complications. Maybe just say something in
the docs, nothing more: a standard conforming change of behavior is
perfectly acceptable for a major release.

Better spend our time elsewhere...

Thanks,
Paolo.



More information about the Libstdc++ mailing list