Index: src/utils.h |
diff --git a/src/utils.h b/src/utils.h |
index dfdf384587e6293b3c316f90c5db4f01feb37428..582c5769936947698217cf5fd5ef219ab7e919eb 100644 |
--- a/src/utils.h |
+++ b/src/utils.h |
@@ -1047,17 +1047,19 @@ template <int dummy_parameter> |
class VectorSlot { |
public: |
explicit VectorSlot(int id) : id_(id) {} |
+ |
int ToInt() const { return id_; } |
static VectorSlot Invalid() { return VectorSlot(kInvalidSlot); } |
bool IsInvalid() const { return id_ == kInvalidSlot; } |
VectorSlot next() const { |
- DCHECK(id_ != kInvalidSlot); |
+ DCHECK_NE(kInvalidSlot, id_); |
return VectorSlot(id_ + 1); |
} |
- bool operator==(const VectorSlot& other) const { return id_ == other.id_; } |
+ bool operator==(VectorSlot that) const { return this->id_ == that.id_; } |
+ bool operator!=(VectorSlot that) const { return !(*this == that); } |
private: |
static const int kInvalidSlot = -1; |
@@ -1066,6 +1068,12 @@ class VectorSlot { |
}; |
+template <int dummy_parameter> |
+size_t hash_value(VectorSlot<dummy_parameter> slot) { |
+ return slot.ToInt(); |
+} |
+ |
+ |
typedef VectorSlot<0> FeedbackVectorSlot; |
typedef VectorSlot<1> FeedbackVectorICSlot; |