This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Why doesn't iter_swap use swap?
- From: Daniel Frey <daniel dot frey at aixigo dot de>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 24 Aug 2004 09:48:40 +0200
- Subject: Re: Why doesn't iter_swap use swap?
- Organization: aixigo AG
- References: <41285BF9.1060004@cs.york.ac.uk>
chris wrote:
Hello,
I suspect this might have a simple answer, but why doesn't iter_swap use
swap? I can't see any immediate disadvantages to this, and it would have
the major advantage that any specialisations of swap would then be used
by iter_swap (which is how I discovered the problem, while trying to
overload swap and then wondering why it wasn't getting used by reverse
and other algorithms...)
Chris
I'm currently discussing the same problem (swap, iter_swap and DR 187)
with some Boost folks. While it looks promising at first that iter_swap
uses ADL to find specializations, it is also intrusive for the user as
he can no longer protect calls from ADL by qualifying them. Also, if a
qualified call to iter_swap uses ADL internally, why doesn't a qualified
call to swap uses ADL, too? Technically it's possible, Howard Hinnard
already tried it out in the Metrowerks STL. We are still undecided
whether or not this is a good idea.
Regards, Daniel
--
Daniel Frey
aixigo AG - financial solutions & technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de