This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why doesn't iter_swap use swap?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]