Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

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