char_traits::compare

char_traits::compare

static int compare(const E *x, const E *y, size_t n);

The static member function compares the sequence of length n beginning at x to the sequence of the same length beginning at y. The function returns:

  • A negative value if the first differing element in x (as determined by eq) compares less than the corresponding element in y (as determined by lt).
  • Zero if the two compare equal element by element.
  • A positive value otherwise.