folly::to_ordering

Convert a signed comparison value into the matching ordering.

Synopsis

Declared in <folly/lang/Ordering.h>

template<typename T>
constexpr
ordering
to_ordering(T c);

Return Value

ordering::lt, ordering::eq, or ordering::gt according to the sign of c.

Parameters

NameDescription
cA value comparable against T(0), such as the result of a three-way comparison or memcmp.