IOFile: Change 'operator void*' into 'explicit operator bool'
'operator void*' is basically a pre-C++11-ism that was used, as C++03 only had the notion of implicit type-conversion operators, but not explicit type conversion operators (allowing implicit conversion of a file handle to bool can go downhill pretty quickly).
This commit is contained in:
parent
c541e1099e
commit
9b8f5bce22
|
@ -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; }
|
||||
operator void*() { return m_good ? m_file : nullptr; }
|
||||
explicit operator bool() const { return IsGood(); }
|
||||
std::FILE* ReleaseHandle();
|
||||
|
||||
std::FILE* GetHandle() { return m_file; }
|
||||
|
|
Loading…
Reference in New Issue