C++ Standard Library adjacent_find() Sample

Description

adjacent_find() finds the first pair of adjacent identical values in an unsorted element sequence, and returns an iterator that references the first element of the pair.

Declaration

	template <class For>
	    For adjacent_find(For, For);
	template <class For, class BinPred>
	    For adjacent_find(For, For, BinPred);

Concept

The sample program sets up a vector of integers, and then calls adjacent_find() to find the first adjacent matching values. An iterator to the first value is returned, and is used to display the sequence of two or more matching values.

Supported
Supported
Supported