Make gtl/int_type.h types hashable in ABSL containers.
(Note ABSL hash functions are templated, and so there's no cost if you don't use them.) PiperOrigin-RevId: 294764409 Change-Id: I19bafd4a19eb6b623a48ce5d136dd5bf6c20e56b
This commit is contained in:
parent
5d6a883849
commit
bceb1d7854
@ -197,6 +197,11 @@ class IntType {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename H>
|
||||
friend H AbslHashValue(H h, const IntType& i) {
|
||||
return H::combine(std::move(h), i.value());
|
||||
}
|
||||
|
||||
public:
|
||||
// Default c'tor initializing value_ to 0.
|
||||
constexpr IntType() : value_(0) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user