1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
hi(lexicographical_compare)
itemization(
it() Header file: tt(<algorithm>)
it() Function prototypes:
itemization(
itt(bool lexicographical_compare([ExecPol,] InputIterator1 first1,
InputIterator1 last1, InputIterator2 first2, InputIterator2 last2);)
itt(bool lexicographical_compare([ExecPol,] InputIterator1 first1,
InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare
comp);)
)
it() Description:
itemization(
it() The first prototype: the corresponding pairs of elements in
the ranges pointed to by the ranges rangett(first1, last1) and rangett(first2,
last2) are compared. The function returns ti(true)
itemization(
it() at the first element in the first range which is less
than the corresponding element in the second range (using tt(operator<)
of the underlying data type),
it() if tt(last1) is reached, but tt(last2) isn't reached yet.
)
False is returned in the other cases, which indicates that the first sequence
is not lexicographically less than the second sequence. So, ti(false) is
returned:
itemization(
it() at the first element in the first range which is greater
than the corresponding element in the second range (using tt(operator<)
of the data type to which the iterators point, reversing the operands),
it() if tt(last2) is reached, but tt(last1) isn't reached yet,
it() if tt(last1) and tt(last2) are reached.
)
it() The second prototype: with this function the binary
comparison operation as defined by tt(comp) is used instead of
tt(operator<) of the data type to which the iterators point.
)
it() Example:
verbinclude(-a examples/lexicographicalcompare.cc)
)
|