Add StreamHandle::operator bool

This commit is contained in:
yvt 2019-05-19 14:53:32 +09:00
parent a8b50e9a69
commit 10fc7da79d
No known key found for this signature in database
GPG Key ID: 48F2768FA8D07C92
2 changed files with 3 additions and 0 deletions

View File

@ -152,6 +152,8 @@ namespace spades {
return o->stream;
}
StreamHandle::operator bool() const { return o->stream; }
void StreamHandle::Reset() {
if (o) {
o->Release();

View File

@ -87,5 +87,6 @@ namespace spades {
void Reset();
IStream *operator->() const;
operator IStream *() const;
operator bool() const;
};
}