The*_* do 3 c++ compile-time
如何检测位置n的位是否设置为常量变量?
ild*_*arn 6
template<std::uint64_t N, std::uint8_t Bit> struct is_bit_set { static bool const value = !!(N & 1u << Bit); };
!!用于简洁地将值强制转换为a bool并避免数据截断编译器警告.
!!
bool
归档时间:
15 年,1 月 前
查看次数:
155 次
最近记录: