79807798

Date: 2025-11-03 11:21:20
Score: 0.5
Natty:
Report link

C++11 brace initialization lets you create a zero of any integral type, if that type has a single identifier, like uint32_t. For unsigned int you'd need a type alias. You can then invert all bits via ~.

auto flags = ~ uint32_t{};
using my_flag_type = unsigned int;
auto flags = ~ my_flag_type{};
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jens