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?

Found the site.
Last edited on
There are two different overoads: - move several things - move one thing

On this site, we only have the algorithm one listed:
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).
<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.