std::string str1 = "Hello, World!"; std::string str2 = std::move(str1); // Move the contents of str1 into str2
std::vectorIn this example, we're creating two vectors - `vec1` and `vec2`. We then use `std::move` to move the contents of `vec1` into `vec2`. Again, this is more efficient than making a copy because we're not actually creating a new vector - we're just pointing `vec2` to the existing data in `vec1`. C++ Move is part of the C++11 standard, so it's included in the standard library. There's no need to install any additional packages to use it - just include the appropriate headers (e.g. `vec1 = {1, 2, 3, 4, 5}; std::vector vec2 = std::move(vec1); // Move the contents of vec1 into vec2