| template< class T >
constexpr bool ispow2(T x) noexcept; |
|
(C++20 起) |
| | |
检查 x 是否为二的整数次幂。
此重载仅若 T 为无符号整数类型(即 unsigned char 、 unsigned short 、 unsigned int 、 unsigned long 、 unsigned long long 或扩展无符号整数类型)才参与重载决议。
[编辑] 返回值
若 x 为二的整数次幂则为 true ;否则为 false 。
[编辑] 示例