Template Class MemCmp

Class Documentation

template <typename KeyTy>
class MemCmp

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 compared
  • second: The second object to be compared

Public Functions

bool operator()(const KeyTy *first, const KeyTy *second) const