There is great confusion surrounding move semantics in C++. I believe I understand, at a basic level, how you can use it to avoid copying data upon returning from a function, but couldn't this always be achieved by returning a reference instead?
Even when copying large data structures, aren't you usually copying a few small pointers to the large data, rather than copying the data itself?
Can you give an example of using move semantics to do something that you couldn't do by simply returning a reference? Or perhaps I'm misunderstanding and that this is mostly a nice-to-have syntactic sugar thing so that you don't have to think about references as much in user code?