|
ALINK="#ff0000">
find
Prototypetemplate<class InputIterator, class EqualityComparable> InputIterator find(InputIterator first, InputIterator last, const EqualityComparable& value); DescriptionReturns the first iterator i in the range [first, last) such that *i == value. Returns last if no such iterator exists.DefinitionDefined in the standard header algorithm, and in the nonstandard backward-compatibility header algo.h.Requirements on types
Preconditions
ComplexityLinear: at most last - first comparisons for equality.Examplelist<int> L; L.push_back(3); L.push_back(1); L.push_back(7); list<int>::iterator result = find(L.begin(), L.end(), 7); assert(result == L.end() || *result == 7); NotesSee alsofind_if.Copyright © 1999 Silicon Graphics, Inc. All Rights Reserved. TrademarkInformation
|