header_utils
Loading...
Searching...
No Matches
ghassanpl::bit_integral Concept Reference

Whether or not a type is integral (but not a bool). More...

#include <bits.h>

Concept definition

template<typename T>
concept ghassanpl::bit_integral = std::is_integral_v<T> && !std::is_same_v<std::decay_t<T>, bool>
Whether or not a type is integral (but not a bool).
Definition bits.h:28

Detailed Description

Whether or not a type is integral (but not a bool).

Rationale
bool being integral is basically a remnant of the old days. Its size is implementation defined, and giving it any values except true (1) or false (0) is pretty much undefined behavior. Therefore the rest of this code uses bit_integral to detect values for which manipulating bits is well defined (that actually represent and are meant to model integers).

Definition at line 28 of file bits.h.