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 jefferson wrote:

If we decided changing iter_swap was too serious an undertaking at this point,

The problem is not that we consider it "serious", just that we don't completely agree with the resolution of the DR and probably we want to change/clarify it.


then according to the standard, should we be using swap() or iter_swap() in our implementation of reverse/sort/etc.etc.? I read it as swap personally.

Could you please substantiate your claim basing on the standard? For reverse, iter_swap is explicitly required (25.2.9, p1) and, looking briefly at the code, swap_ranges needs iter_swap, due to the different types.


On the other hand, if/where we are allowed to chose we can use the most efficient one, of course...

Paolo.


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