std::ispow2 (3) - Linux Man Pages

std::ispow2: std::ispow2


std::ispow2 - std::ispow2


Defined in header <bit>
template< class T > (since C++20)
constexpr bool ispow2(T x) noexcept;

Checks if x is an integral power of two.
This overload only participates in overload resolution if T is an unsigned integer type (that is, unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long, or an extended unsigned integer type).

Return value

true if x is an integral power of two; otherwise false.


 This section is incomplete
 Reason: no example