Move Semantics in C++

Move semantics might sound like a scary term, but it's relatively easy to understand. This post will explain some of the basic concepts of move semantics, and how important they can be!


References

Before we begin with move semantics, let's do a quick refresher on references. Consider the code below:


int main() {
std::vector vect;
function1(vect);
function2(vect);
}

void function1(std::vector v) {
/*
* This is passing an argument by value
* Modification of "v" here won'...
 •  0 comments  •  flag
Share on Twitter
Published on October 09, 2020 17:58
No comments have been added yet.