iter_swapping vector<bool>::iterator..
Bo Persson
bop@gmb.dk
Fri Mar 18 16:37:00 GMT 2005
----- Original Message -----
From: "Paolo Carlini" <pcarlini@suse.de>
To: "Chris Jefferson" <caj@cs.york.ac.uk>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>
Sent: Friday, March 18, 2005 4:47 PM
Subject: Re: iter_swapping vector<bool>::iterator..
> Anyone knows whether other implementors are able to provide a
> vector<bool>::iterator
> which meets the forward iterator requirements? Everything really boils
> down to this,
> in my opinion.
>
That is just impossible!
The underlying problem is, of course, that a vector<bool> doesn't store
any bools. When dereferencing an iterator into the container, you are
supposed to get a reference to a bool. But there aren't any bools
around...
Implementations can't fix this, only the committee can - by changing at
least one of the rules. They just have to agree on which one!
Bo Persson
More information about the Libstdc++
mailing list