# std::ispow2

From cppreference.com
< cpp‎ | numeric

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

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.

### Example

| This section is incomplete Reason: no example

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/ispow2&oldid=104208"