Template Class MemCmp¶
- Defined in File compare_and_hash_utils.h
Class Documentation¶
-
template <typename KeyTy>
classMemCmp
¶ Comparison functor.
This functor compares two object of type KeyTy.
Typical Usage:
struct A { int a, b; }; void fn(A value1, A value2) { if (!MemCmp()(&value1, &value2)) { // they are equal so do something } else { // do sothing different } }
- Return
- false if first == second, true otherwise.
- Template Parameters
KeyTy
: The type of the two keys to compare.
- Parameters
first
: The first object to be comparedsecond
: The second object to be compared
Public Functions
-
bool
operator()
(const KeyTy *first, const KeyTy *second) const¶