Skip to content

std::Memory::exchange<T>

exchange<T>

Atomically exchanges the value at the pointer with the specified value, returns the old value

Template Parameters

  • T

Signature

fn exchange(ptr: *T, value: T) -> &T requires <T>;