C++ 本身有引用 &,为什么 C++11 又引入了 std::ref?主要是考虑函数式编程如 std::bind 在使用时,是对参数直接拷贝,而不是引用。如下例子:
void f(int& n1, int& n2,
2019-04-18