该功能函数包含在头文件<utility>
功能:用新值替换一个对象的旧值,并返回旧值。
语法原型:template<class T, class U = T> T exchange(T& obj, U&& new_value);