Exchange()

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)

Template parameters

ParameterDescription
TVariable type.

Arguments

ParameterTypeDescription
location1T&Variable reference to change.
valueTValue to store.

Return Value

Value of variable right before it was changed.

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)

Template parameters

ParameterDescription
TVariable type.

Arguments

ParameterTypeDescription
location1T&Variable reference to change.
valueTValue to store.

Return Value

Value of variable right before it was changed.

See Also