22 General utilities library [utilities]

22.12 Header <stdbit.h> synopsis [stdbit.h.syn]

#define __STDC_VERSION_STDBIT_H__ 202311L #define __STDC_ENDIAN_BIG__ see below #define __STDC_ENDIAN_LITTLE__ see below #define __STDC_ENDIAN_NATIVE__ see below unsigned int stdc_leading_zeros_uc(unsigned char value); unsigned int stdc_leading_zeros_us(unsigned short value); unsigned int stdc_leading_zeros_ui(unsigned int value); unsigned int stdc_leading_zeros_ul(unsigned long int value); unsigned int stdc_leading_zeros_ull(unsigned long long int value); template<class T> see below stdc_leading_zeros(T value); unsigned int stdc_leading_ones_uc(unsigned char value); unsigned int stdc_leading_ones_us(unsigned short value); unsigned int stdc_leading_ones_ui(unsigned int value); unsigned int stdc_leading_ones_ul(unsigned long int value); unsigned int stdc_leading_ones_ull(unsigned long long int value); template<class T> see below stdc_leading_ones(T value); unsigned int stdc_trailing_zeros_uc(unsigned char value); unsigned int stdc_trailing_zeros_us(unsigned short value); unsigned int stdc_trailing_zeros_ui(unsigned int value); unsigned int stdc_trailing_zeros_ul(unsigned long int value); unsigned int stdc_trailing_zeros_ull(unsigned long long int value); template<class T> see below stdc_trailing_zeros(T value); unsigned int stdc_trailing_ones_uc(unsigned char value); unsigned int stdc_trailing_ones_us(unsigned short value); unsigned int stdc_trailing_ones_ui(unsigned int value); unsigned int stdc_trailing_ones_ul(unsigned long int value); unsigned int stdc_trailing_ones_ull(unsigned long long int value); template<class T> see below stdc_trailing_ones(T value); unsigned int stdc_first_leading_zero_uc(unsigned char value); unsigned int stdc_first_leading_zero_us(unsigned short value); unsigned int stdc_first_leading_zero_ui(unsigned int value); unsigned int stdc_first_leading_zero_ul(unsigned long int value); unsigned int stdc_first_leading_zero_ull(unsigned long long int value); template<class T> see below stdc_first_leading_zero(T value); unsigned int stdc_first_leading_one_uc(unsigned char value); unsigned int stdc_first_leading_one_us(unsigned short value); unsigned int stdc_first_leading_one_ui(unsigned int value); unsigned int stdc_first_leading_one_ul(unsigned long int value); unsigned int stdc_first_leading_one_ull(unsigned long long int value); template<class T> see below stdc_first_leading_one(T value); unsigned int stdc_first_trailing_zero_uc(unsigned char value); unsigned int stdc_first_trailing_zero_us(unsigned short value); unsigned int stdc_first_trailing_zero_ui(unsigned int value); unsigned int stdc_first_trailing_zero_ul(unsigned long int value); unsigned int stdc_first_trailing_zero_ull(unsigned long long int value); template<class T> see below stdc_first_trailing_zero(T value); unsigned int stdc_first_trailing_one_uc(unsigned char value); unsigned int stdc_first_trailing_one_us(unsigned short value); unsigned int stdc_first_trailing_one_ui(unsigned int value); unsigned int stdc_first_trailing_one_ul(unsigned long int value); unsigned int stdc_first_trailing_one_ull(unsigned long long int value); template<class T> see below stdc_first_trailing_one(T value); unsigned int stdc_count_zeros_uc(unsigned char value); unsigned int stdc_count_zeros_us(unsigned short value); unsigned int stdc_count_zeros_ui(unsigned int value); unsigned int stdc_count_zeros_ul(unsigned long int value); unsigned int stdc_count_zeros_ull(unsigned long long int value); template<class T> see below stdc_count_zeros(T value); unsigned int stdc_count_ones_uc(unsigned char value); unsigned int stdc_count_ones_us(unsigned short value); unsigned int stdc_count_ones_ui(unsigned int value); unsigned int stdc_count_ones_ul(unsigned long int value); unsigned int stdc_count_ones_ull(unsigned long long int value); template<class T> see below stdc_count_ones(T value); bool stdc_has_single_bit_uc(unsigned char value); bool stdc_has_single_bit_us(unsigned short value); bool stdc_has_single_bit_ui(unsigned int value); bool stdc_has_single_bit_ul(unsigned long int value); bool stdc_has_single_bit_ull(unsigned long long int value); template<class T> bool stdc_has_single_bit(T value); unsigned int stdc_bit_width_uc(unsigned char value); unsigned int stdc_bit_width_us(unsigned short value); unsigned int stdc_bit_width_ui(unsigned int value); unsigned int stdc_bit_width_ul(unsigned long int value); unsigned int stdc_bit_width_ull(unsigned long long int value); template<class T> see below stdc_bit_width(T value); unsigned char stdc_bit_floor_uc(unsigned char value); unsigned short stdc_bit_floor_us(unsigned short value); unsigned int stdc_bit_floor_ui(unsigned int value); unsigned long int stdc_bit_floor_ul(unsigned long int value); unsigned long long int stdc_bit_floor_ull(unsigned long long int value); template<class T> T stdc_bit_floor(T value); unsigned char stdc_bit_ceil_uc(unsigned char value); unsigned short stdc_bit_ceil_us(unsigned short value); unsigned int stdc_bit_ceil_ui(unsigned int value); unsigned long int stdc_bit_ceil_ul(unsigned long int value); unsigned long long int stdc_bit_ceil_ull(unsigned long long int value); template<class T> T stdc_bit_ceil(T value);
For a function template whose return type is not specified above, the return type is an implementation-defined unsigned integer type large enough to represent all possible result values.
Each function template has the same semantics as the corresponding type-generic function with the same name specified in ISO/IEC 9899:2024, 7.18.
Mandates: T is an unsigned integer type.
Otherwise, the contents and meaning of the header <stdbit.h> are the same as the C standard library header <stdbit.h>.
See also: ISO/IEC 9899:2024, 7.18