Iterate from bset . _Find_first ( ) to bset . size ( ) - 1
for ( int i = bset . _Find_first ( ) ; i < bset . size ( ) ; i = bset . _Find_next ( i ) ) { if ( i + 1 > len ) break ; cout << i + 1 << endl ; } }