C++ Standard Library find_first_of() Sample

Description

find_first_of() is used to find the first element of an unsorted sequence, that is also found in a second sequence.

Declaration

	template <class For, class For2>
	    For find_first_of(For, For, For2, For2);
	template <class For, class For2, class BinPred>
	    For find_first_of(For, For, For2, For2, BinPred);

Concept

The sample program creates two vectors of integers, and then calls find_first_of() to identify the first element in the first vector, that is also in the second vector. In this example a user-defined predicate is specified, such that the absolute values of the integer values are compared. The result of this operation is -3.

Supported
Supported
Supported