C++0x const RValue reference as function parameter
问题 I am trying to understand why someone would write a function that takes a const rvalue reference . In the code example below what purpose is the const rvalue reference function (returning "3"). And why does overload resolution preference the const Rvalue above the const LValue reference function (returning "2"). #include <string> #include <vector> #include <iostream> std::vector<std::string> createVector() { return std::vector<std::string>(); } //takes movable rvalue void func(std::vector<std