Standard C++ Library Class Reference
 // find the smallest element 
 iterator it3 = min_element(v1.begin(), v1.end()); 
 // it3 = v1.begin() 
 // find the smallest value in the range from
 // the beginning of the vector plus 1 to the end
 iterator it4 = min_element(v1.begin()+1, v1.end(), 
 less<int>()); 
 // it4 = v1.begin() + 1
 cout << *it1 << " " << *it2 << " " 
 << *it3 << " " << *it4 << endl;
 return 0;
 }
Output :
64 32 1 3
Warning
If your compiler does not support default template parameters then you need to always supply
the Allocator template argument. For instance you'll have to write:
vector<int,allocator>
instead of:
vector<int>
See Also
max, min, min_element










