Question: I have a problem that when c++ evaluates the while statement, it also evaluates the underlying if statement even if the while statement condition is not met.

ite\_candidats is a custom iterator on a binary map tree. When there is no more nodes to visit, ite\_candidat evaluates to NULL. So the while ends. But, I get a assertion failure from ite\_candidats.clecourante() call, saying my underlying node is NULL. It shouldn't evaluate ite\_candidats.clecourante() because it wasn't meant to get to it.

I ran the program in debug mode, and !!ite\_candidats really evaluates to false when there is no more nodes to visit. If I comment out the if block, the program gets out of the while loop and everything is ok...

The operator overloading of ite\_candidats operator bool() doesn't call clecourante().

```
while(!!ite_candidats){
    if(ite_candidats.clecourante() != nompersonne){
        {...}
    }
    ite_candidats++;
}

```

Answer: 
It is impossible. If it evaluates `if` then it enters into `while`. No ahead computation is `C++`.

P.S. Why do you have two negations in `while`?
rough guess: ite\_candidats is incremented in the code. probably the end iterator is not evaluating to 0.