template <typename T>
struct StrictIntegralType
Defined at line 113 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h
This type makes sure that we don't accidentally promote an integral type to
another one. It is only constructible from the exact T type.
Public Methods
template <typename U, cpp::enable_if_t<cpp::is_same_v<U, T>, bool> = 0>
void StrictIntegralType<T> (U value)
Can only be constructed from a T.
Defined at line 118 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h
bool operator bool ()
Allows using the type in an if statement.
Defined at line 121 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h
StrictIntegralType<T> operator| (const StrictIntegralType<T> & Rhs)
If type is unsigned (bcmp) we allow bitwise OR operations.
Defined at line 124 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h
int operator int ()
For interation with the C API we allow explicit conversion back to the
`int` type.
Defined at line 132 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h
StrictIntegralType<T> zero ()
Helper to get the zero value.
Defined at line 138 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h
StrictIntegralType<T> nonzero ()
Defined at line 139 of file ../../third_party/llvm-libc/src/src/string/memory_utils/utils.h