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
|
hi(upper_bound)
itemization(
it() Header file: tt(<algorithm>)
it() Function prototypes:
itemization(
itt(ForwardIterator upper_bound(ForwardIterator first,
ForwardIterator last, Type const &value);)
itt(ForwardIterator upper_bound(ForwardIterator first,
ForwardIterator last, Type const &value, Compare comp);)
)
it() Description:
itemization(
it() The first prototype: the sorted elements (using ascending
sort) stored in the iterator range rangett(first, last) are searched for the
first element that is greater than tt(value). The returned iterator marks the
first location in the sequence where tt(value) can be inserted without
breaking the sorted order of the elements using ti(operator<) of the data type
to which the iterators point. If no such element is found, tt(last) is
returned.
it() The second prototype: the elements implied by the iterator
range rangett(first, last) must have been sorted using the tt(comp) function
or function object. Each element in the range is compared to tt(value) using
the tt(comp) function. An iterator to the first element for which the binary
predicate tt(comp), applied to the elements of the range and tt(value),
returns tt(true) is returned. If no such element is found, tt(last) is
returned.
)
it() Example:
verbinclude(-a examples/upperbound.cc)
)
|