System::Threading::Interlocked::Exchange method

Interlocked::Exchange(T&, T) method

Exchanges value on variable: stores new value and returns the value variable had immediately before storing.

template<typename T> static std::enable_if<IsSupportedInt<T>, T>::type System::Threading::Interlocked::Exchange(T &location1, T value)
ParameterDescription
TVariable type.
ParameterTypeDescription
location1T&Variable reference to change.
valueTValue to store.

ReturnValue

Value of variable right before it was changed.

See Also

Interlocked::Exchange(T&, T) method

Exchanges value on variable: stores new value and returns the value variable had immediately before storing. Not implemented.

template<typename T> static std::enable_if<!IsSupportedInt<T>, T>::type System::Threading::Interlocked::Exchange(T &location1, T value)
ParameterDescription
TVariable type.
ParameterTypeDescription
location1T&Variable reference to change.
valueTValue to store.

ReturnValue

Value of variable right before it was changed.

See Also