c++ - Behavior of mutating STL algorithms acting on sequences of movable but non-copyable objects -
if have class foo movable non-copyable , store in std::vector, applying algorithm partition or sort have caveats? part of these algorithms should correctly implemented no-throw swap guarantee correct behavior?
yes.
http://en.cppreference.com/w/cpp/algorithm/partition
http://en.cppreference.com/w/cpp/algorithm/sort
with respect element behavior, both algorithms require iterator can swap elements, meaning if it's movable type , container implemented correctly, behavior correct.
Comments
Post a Comment