++


find_first_of()


template< class ForwardIterator1, class ForwardIterator2 >

ForwardIterator1

find_first_of( ForwardIterator1 first1, ForwardIterator1 last1,

ForwardIterator2 first2, ForwardIterator2 last2 );

template< class ForwardIterator1, class ForwardIterator2,

class BinaryPredicate >

ForwardIterator1

find_first_of( ForwardIterator1 first1, ForwardIterator1 last1,

ForwardIterator2 first2, ForwardIterator2 last2,

BinaryPredicate pred );

, [first2,last2), , , [first1,last1). , synesthesia. aeiou. find_first_of() , , e. , last1. , , pred.

#include <algorithm>

#include <vector>

#include <string>

#include <iostream.h>

 

int main()

{

string s_array[] = { "Ee", "eE", "ee", "Oo", "oo", "ee" };

 

// "ee" -- &s_array[2]

string to_find[] = { "oo", "gg", "ee" };

string *found_it =

find_first_of( s_array, s_array+6,

to_find, to_find+3 );

// :

// : ee

// &s_array[2]: 0x7fff2dac

// &found_it: 0x7fff2dac

 

if ( found_it != &s_array[6] )

cout << ": " << *found_it << "\n\t"




- -  - -  - -