__builtin_ _Find_first()

• int __builtin_ffs (unsigned int x)
Returns the last bit x 1 is the first of several from back to front, such as 7368 (1110011001000) returns 4.
• int __builtin_clz (unsigned int x)
returns the number of leading zero.
• int __builtin_ctz (unsigned int x)
returns the number of the back of all 0, and the relative __builtin_clz.
• int __builtin_popcount (unsigned int x)
Returns the binary representation of the number 1.
• int __builtin_parity (unsigned int x)
returns the parity bits of x, which is the result of a number of modulo x 2.

Further, these functions have corresponding usigned long and usigned long long version, simply by adding or ll l after the function name on it, such as int __builtin_clzll

for(int i = B._Find_first(); i != B.size(); i = B._Find_next(i))

Guess you like

Origin www.cnblogs.com/Aragaki/p/11291562.html