folly::isPowTwo

Return true if and only if v is a power of two.

Synopsis

Declared in <folly/lang/Bits.h>

template<class T>
constexpr
bool
isPowTwo(T const v);

Return Value

True if v is a power of two.

Parameters

NameDescription
vThe unsigned value to test.