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: Fix stable_sort to work on iterators returning rvalue


On Fri, 25 May 2012, François Dumont wrote:

dereference the iterator as late as possible

Cool :-)


that is to say only when we need to pass it to the std::move function.

As a side note, I am wondering whether, once the relevant DR is fixed, we should aim to avoid move(*iter) and use *make_move_iterator(iter) instead (or something similar, with the main effect that it doesn't turn temporaries into rvalue references). It wouldn't have any effect here, but in other cases it might allow the compiler to elide a move construction.


--
Marc Glisse


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