标签为‘C++0x’的文章

C++右值引用-好东西

解决C++中临时变量的好方法-右值引用,可在visual studio 2010中试试

右值引用和移动语义(rvalue references, move semantics)
该特性比较晦涩,但用途很明确。
* 移动语义 考虑swap函数template <class T> swap(T& a, T& b){ T tmp(a); // now we have two copies of a a = b; // now we have two copies of b b = tmp; [...]

More »