How is IF( object ) evaluated? Follows from SD card example sketch
There is an operator bool which does the test:

File::operator bool() {
  if (_file) 
    return  _file-&gt;isOpen();
  return false;
}


When used inside an if the compiler invokes the operator bool() which does the test you see above.