std::move - Linear or constant?

First off, I have no idea how move actually happens. Anyways, on our site we have std::move as O(n) complexity. But on some other site (cprogramming? I forget) they had it listed as O(1) complexity. Big difference, so which is it?

EDIT:
Found the site. http://en.cppreference.com/w/cpp/utility/move
Last edited on
There are two different overoads:
http://en.cppreference.com/w/cpp/algorithm/move - move several things
http://en.cppreference.com/w/cpp/utility/move - move one thing

On this site, we only have the algorithm one listed:
http://www.cplusplus.com/reference/algorithm/move/
The utility one is not on this site yet :(
Last edited on
algorithm::move. I didn't catch the difference earlier. I guess that clears up the confusion now, they are both O(n).
/thread
<algorithm>'s move is O(n)
<utility>'s move is O(1)

Also, mark as solved.
Last edited on
The utility one is essentially a no-op. It just returns an rvalue reference to the parameter it is fed.
Last edited on
Topic archived. No new replies allowed.