File: maxelement.yo

package info (click to toggle)
c%2B%2B-annotations 12.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,044 kB
  • sloc: cpp: 24,337; makefile: 1,517; ansic: 165; sh: 121; perl: 90
file content (25 lines) | stat: -rw-r--r-- 1,045 bytes parent folder | download | duplicates (4)
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
    hi(max_element)
    itemization(
        it() Header file: tt(<algorithm>)
        it() Function prototypes:
        itemization(
            itt(ForwardIterator max_element(ForwardIterator first,
ForwardIterator last);)
            itt(ForwardIterator max_element(ForwardIterator first,
ForwardIterator last, Comparator comp);)
        )
        it() Description:
        itemization(
            it() The first prototype: an iterator pointing to the largest
element in the range implied by rangett(first, last) is returned. The
ti(operator<) of the data type to which the iterators point is used to decide
which of the elements is the largest.
            it() The second prototype: rather than using tt(operator<), the
binary predicate tt(comp) is used to make the comparisons between the elements
implied by the iterator range rangett(first, last). The element for which
tt(comp) returns most often tt(true), compared with other elements, is
returned.
        )
        it() Example:
        verbinclude(-a examples/maxelement.cc)
    )