Using STL move instead of loops.