unittest/sudokucelltest.cpp
// Returns true if two or more bits are set (equal to 1), or false otherwise.
Returns true if two or more bits are set (equal to 1), or false otherwise.
Returns true if two or more bits are set ( equal to 1 ) or false otherwise .
bool SudokuCellTest::hasMultipleCandidates(SudokuCellCandidates candidates) {
    auto found = false;
    auto restCandidates = candidates;
    for(size_t i=0; i < bitsOf(restCandidates); ++i) {
        if ((restCandidates & 1) == 1) {
            if (found != false) {
                return true;
            } else {
                found = true;
            }
        }
        restCandidates >>= 1;
    }
    return false;
}
bool SudokuCellTest :: hasMultipleCandidates ( SudokuCellCandidates candidates ) { auto found = false ; auto restCandidates = candidates ; for ( size_t i = 0 ; i < bitsOf ( restCandidates ) ; ++ i ) { if ( ( restCandidates & 1 ) == 1 ) { if ( found != false ) { return true ; } else { found = true ; } } restCandidates >>= 1 ; } return false ; }
Returns true if two or more bits are set (equal to 1), or false otherwise.
Returns true if two or more bits are set ( equal to 1 ) or false otherwise .
// 2 bits are equal to 1 // a bit that equals to 1 is found