Using is_open() instead of implicit bool conversion