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:
Peter Hawkins 2020-02-12 14:56:49 -08:00 committed by TensorFlower Gardener
parent 5d6a883849
commit bceb1d7854

View File

@ -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) {}