folly::Synchronized::exchange

Exchange datum.

Synopsis

Declared in <folly/Synchronized.h>

T
exchange(T&& rhs);

Description

Assign another datum and return the original value. Recommended because it keeps the mutex held only briefly.

Return Value

The previous value of the datum.

Parameters

NameDescription
rhsThe new datum to assign.