P
pauldepstein
From C++ Primer:
BEGIN QUOTE
Algorithms to find one of many values. These algorithms require two
pairs of forward iterators. They search for the first (or last)
element in the first range that is equal to any element in the second
range ... There is no requirement that the types of beg1 and beg2
match exactly. However, it must be possible to compare the element
types of the two sequences. So, for example, if the first sequence is
a list<string>, then the second could be a vector<char*>.
.... find_first_of(beg1, end1, beg2, end2) Returns an iterator to the
first occurrence in the first range of any element from the second
range ...
END QUOTE
Could someone explain any rules (or rules of thumb) for determining
when elements can be compared between the ranges? For example, I
would not know that it was legal to compare vector<char*> members with
list<string> members.
Thank you very much for your help.
Regards,
Paul Epstein
BEGIN QUOTE
Algorithms to find one of many values. These algorithms require two
pairs of forward iterators. They search for the first (or last)
element in the first range that is equal to any element in the second
range ... There is no requirement that the types of beg1 and beg2
match exactly. However, it must be possible to compare the element
types of the two sequences. So, for example, if the first sequence is
a list<string>, then the second could be a vector<char*>.
.... find_first_of(beg1, end1, beg2, end2) Returns an iterator to the
first occurrence in the first range of any element from the second
range ...
END QUOTE
Could someone explain any rules (or rules of thumb) for determining
when elements can be compared between the ranges? For example, I
would not know that it was legal to compare vector<char*> members with
list<string> members.
Thank you very much for your help.
Regards,
Paul Epstein