Common: Enforce explicit handle validation
Some checks failed
Doxygen Action / build (push) Has been cancelled
Some checks failed
Doxygen Action / build (push) Has been cancelled
Some invalid handle values are -1 or INVALID_HANDLE_VALUE, hence our handle template has a specific invalid handle value parameter we should always test against. Time and again, I find my code simply comparing handle against zero. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
c014480acb
commit
e4f28df310
@ -323,6 +323,10 @@ namespace macstd
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
// Force use of valid() method when testing handle.
|
||||
operator bool() const;
|
||||
|
||||
protected:
|
||||
T m_h; ///< Object handle
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user