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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -