Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 447 Bytes

min_element.md

File metadata and controls

15 lines (11 loc) · 447 Bytes

min_element

Description : Returns an iterator to the smallest element in a range defined by [first, last).

Example:

    std::vector<int> vec = {3, -1, 2, 10, 4};

    auto smallestIt = std::min_element(vec.begin(), vec.end()); 
    // prints -1
    std::cout << "The smallest element is " << *smallestIt << '\n';

See Sample code Run Code