Returning std::vector with std::move [duplicate]
You declare a function to return by r-value reference – this should almost never be done (if you return the local object by reference, you will end up with a dangling reference). Instead declare the function to return by value. This way the caller’s value will be move constructed by the r-value returned by the … Read more