The _Find_next() is a built-in function in C++ Biteset class which returns an integer which refers the position of next set bit in bitset after index. If there isn’t any set bit after index, _Find_next(index) will return the size of the bitset.
iterator bitset._Find_next(index) or int bitset._Find_next(index)
Parameters: The function accepts one mandatory parameter index which specifies the index after which the first set bit is to be found in the bitset.
Return Value: The function returns an integer which refers to the position of next set bit in bitset after specified index. If there isn’t any set bit after index(the specified index), _Find_next(index) will return the size of the bitset.
Below is the illustration of the above function:
Next set bit after index 0 in bset 5 Next set bit after index 6 in bset 10 Find all set bits in bset1 0 12 17 30 Next set bit after index 5 in bset2 32
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- _Find_first() function in C++ bitset with Examples
- bitset all() function in C++ STL
- bitset set() function in C++ STL
- bitset reset() function in C++ STL
- std::bitset::to_ullong and std::bitset::to_ulong in C++ STL
- bitset any() in C++ STL
- bitset none() in C++ STL
- C++ bitset and its application
- bitset test() in C++ STL
- bitset operator in C++ STL
- bitset count() in C++ STL
- bitset size() in C++ STL
- bitset::flip() in C++ STL
- Subset sum queries using bitset
- C++ bitset interesting facts
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.