ΒΆtemplate <class T, class U>
inline constexpr T replace(T& dest,
                           const U& src) noexcept

Description

Replace the `dest` with `src`, and return the old value in `dest`. This is equivalent to: ``` T old = sus::move(dest); dest = sus::forward <T >(src); return old; ``` This operation is known as `std::exchange()` in the stdlib.

Declared at: sus/mem/replace.h:46

Templates

T
U

Parameters

T& dest
const U& src