iter_swapping vector<bool>::iterator..
Chris Jefferson
caj@cs.york.ac.uk
Mon Mar 21 15:00:00 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paolo Carlini wrote:
| Paolo Carlini wrote:
|
|> Ok, then let's ask Chris to provide a solution fo this issue, as already
|> outlined in various messages.
|
|
| To be clear, I mean adding an overload: among the various proposals seems
| the one which people like most (myself included ;)
|
Actually, I might have come up with a better way of dealing with it :)
This patch makes sure that we only use swap to implement iter_swap when
value_type& = reference_type (which should be true for all forward
iterators, which is in theory all we should accept!)
I've attached iter_swap_patch (a very small patch to iter_swap in
stl_algobase.h), a test case (20577.cc) and a Changelog. Sorry that this
isn't slightly neater.. If you have some code with some vector<bool>s
(and things derived from them), it would be really nice if you could
test it :)
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
iD8DBQFCPt6r3FpDzErifpIRAqSTAJ9kWCTbHSBHi1GRwPvkReHo2XIT+wCdHro3
CHzXN96dI34jWEcyN1ua6CU=
=zrty
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: iter_swap_patch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050321/ee6346a8/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_20577
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050321/ee6346a8/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20577.cc
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050321/ee6346a8/attachment.cc>
More information about the Libstdc++
mailing list