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:
parent
9967b41eae
commit
8fc9a7e56b
@ -3167,6 +3167,11 @@ namespace stdex
|
|||||||
open(filename.c_str(), mode);
|
open(filename.c_str(), mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Returns true if file has a valid handle
|
||||||
|
///
|
||||||
|
inline operator bool() const noexcept { return m_source; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
file m_source;
|
file m_source;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user