folly::is_non_negative

Determines whether a value is non-negative, the same as x >= 0.

Synopsis

Declared in <folly/Traits.h>

template<typename T>
constexpr
bool
is_non_negative(T x);

Return Value

true if x is greater than or equal to zero.

Parameters

NameDescription
xThe value to test.