stream: allow invalid handle detection in cached_file

Otherwise one cannot distinguish between file open but in failed state
and file not open.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2023-12-06 15:25:48 +01:00
parent 9967b41eae
commit 8fc9a7e56b

View File

@ -3167,6 +3167,11 @@ namespace stdex
open(filename.c_str(), mode);
}
///
/// Returns true if file has a valid handle
///
inline operator bool() const noexcept { return m_source; }
protected:
file m_source;
};