Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 603 Bytes

adjacent_find.md

File metadata and controls

15 lines (11 loc) · 603 Bytes

adjacent_find

Description : Binary function which returns first adjacent element pairs based on certain condition (as third argument). Default condition checks equality.

Example :

    std::vector<int> v{ 1, 2, 3, 4, 4, 3, 7, 8, 9, 10 };
 
    // Binary function which returns first adjacent element pairs based on certain condition (as third argument) . 
    // Default condition checks equality.
    auto i  = std::adjacent_find (v.begin(), v.end());
    std::cout << "The first pair of repeated elements are: " << *i <<'\n';

Run Code