EmbeddedProto icon indicating copy to clipboard operation
EmbeddedProto copied to clipboard

Use rvalue references correctly

Open darkdragon-001 opened this issue 3 years ago • 1 comments

const rvalue reference doesn't give any advantages over the copy constructor, so there is no need of defining it, as an rvalue can also be used as a const lvalue. This PR creates move constructors which actually move the contents where possible.

One might need to #include <utility> for std::move() or use a static cast instead as it is equivalent (quoting from the manual):

It is exactly equivalent to a static_cast to an rvalue reference type.

darkdragon-001 avatar Sep 05 '22 17:09 darkdragon-001

I am working out how to properly test this. A bit more time is required.

BartHertog avatar Sep 13 '22 19:09 BartHertog

Why has this been closed? Which outcome did your tests have?

darkdragon-001 avatar Mar 23 '23 20:03 darkdragon-001