make all negative handles invalid, not just -1

This commit is contained in:
Max Lyon
2016-10-21 09:21:18 +02:00
parent 2502b58649
commit 523e3e10f4

View File

@@ -73,8 +73,8 @@ public:
/// Get the underlying index of this handle /// Get the underlying index of this handle
int idx() const { return idx_; } int idx() const { return idx_; }
/// The handle is valid iff the index is not equal to -1. /// The handle is valid iff the index is not negative.
bool is_valid() const { return idx_ != -1; } bool is_valid() const { return idx_ >= 0; }
/// reset handle to be invalid /// reset handle to be invalid
void reset() { idx_=-1; } void reset() { idx_=-1; }