collate::do_compare

A virtual function called to compare two character sequences according to their facet-specific rules for equality or inequality.

virtual int do_compare( 
   const CharType* _First1, 
   const CharType* _Last1, 
   const CharType* _First2, 
   const CharType* _Last2 
) const;

Parameters

  • _First1
    Pointer to the first element in the first sequence to be compared.

  • _Last1
    Pointer to the last element in the first sequence to be compared.

  • _First2
    Pointer to the first element in the second sequence to be compared.

  • _Last2
    Pointer to the last element in the second sequence to be compared.

Return Value

The member function returns:

  • -1 if the first sequence compares less than the second sequence.

  • +1 if the second sequence compares less than the first sequence.

  • 0 if the sequences are equivalent.

Remarks

The protected virtual member function compares the sequence at [_First1, Last1) with the sequence at [_First2, _Last2). It compares values by applying operator< between pairs of corresponding elements of type CharType. The first sequence compares less if it has the smaller element in the earliest unequal pair in the sequences or if no unequal pairs exist but the first sequence is shorter.

Example

See the example for collate::compare, which calls do_compare.

Requirements

Header: <locale>

Namespace: std

See Also

Reference

collate Class