diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2017-01-09 05:07:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-09 05:07:06 +0100 |
| commit | 91044178ef97d02b8b596c911ba3f8ecda7a9d4b (patch) | |
| tree | f39ff8040d49026c2dea51bdf26e063d4f6a3baf | |
| parent | 0869c63048423dd11c3072f561d812cecf0a7297 (diff) | |
| parent | 1dab2c8816b6cd991787d203c1bba2cb52406c63 (diff) | |
Merge pull request #4636 from lioncash/file
IOFile: Correct explicit operator bool semantics
| -rw-r--r-- | Source/Core/Common/FileUtil.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index ef012ad4ff..755dfcd6e8 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -211,7 +211,7 @@ public: bool IsOpen() const { return nullptr != m_file; } // m_good is set to false when a read, write or other function fails bool IsGood() const { return m_good; } - explicit operator bool() const { return IsGood(); } + explicit operator bool() const { return IsGood() && IsOpen(); } std::FILE* ReleaseHandle(); std::FILE* GetHandle() { return m_file; } |
