These were added to make comparison logic easier without messy casts:
template<typename K> bool primitive_equals(const K& k0, const K& k1) {
return k0 == k1;
}
template<typename K> int primitive_compare(const K& k0, const K& k1) {
return ((k0 < k1) ? -1 : (k0 == k1) ? 0 : 1);
}
but the name "primitive" is not right as it is used for pointer types as well. Can we come up with a better name?
Ref discussions in: https://github.com/openjdk/jdk/pull/15233
template<typename K> bool primitive_equals(const K& k0, const K& k1) {
return k0 == k1;
}
template<typename K> int primitive_compare(const K& k0, const K& k1) {
return ((k0 < k1) ? -1 : (k0 == k1) ? 0 : 1);
}
but the name "primitive" is not right as it is used for pointer types as well. Can we come up with a better name?
Ref discussions in: https://github.com/openjdk/jdk/pull/15233