System::Threading::Interlocked::Exchange 方法

Interlocked::Exchange(T&, T) method

交换变量的值:存储新值并返回存储前变量原有的值。

template<typename T> static std::enable_if<IsSupportedInt<T>, T>::type System::Threading::Interlocked::Exchange(T &location1, T value)
参数描述
T变量类型。
参数类型描述
location1T&用于更改的变量引用。
T要存储的值。

ReturnValue

变量在被更改前的值。

另见

Interlocked::Exchange(T&, T) method

交换变量的值:存储新值并返回存储前变量原有的值。未实现。

template<typename T> static std::enable_if<!IsSupportedInt<T>, T>::type System::Threading::Interlocked::Exchange(T &location1, T value)
参数描述
T变量类型。
参数类型描述
location1T&用于更改的变量引用。
T要存储的值。

ReturnValue

变量在被更改前的值。

另见