Replace the value of an object and return its old value.
Synopsis
Declared in <absl/utility/utility.h>
template<
class T1,
class T2 = T1>
[[deprecated]]
constexpr
T1
exchange(
T1& obj,
T2&& new_value) noexcept(/* see-below */);
|
Warning
|
Deprecated. Use of this entity is allowed but discouraged. |
Exception specification
This function is potentially-throwing unless noexcept(std::exchange(std::declval<T1 &>(), std::declval<T2>())).
Return Value
The previous value of obj.
Parameters
Name |
Description |
obj |
The object whose value is replaced. |
new_value |
The value to assign to |
Created with MrDocs