Fix stable_sort to work on iterators returning rvalue

Marc Glisse marc.glisse@inria.fr
Mon May 28 09:52:00 GMT 2012


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



More information about the Libstdc++ mailing list