hey i have question, what if in the range i provide to max_element, there are two or more elements equal which are the largest?
which 1 would it return?
Printable View
hey i have question, what if in the range i provide to max_element, there are two or more elements equal which are the largest?
which 1 would it return?
It returns (an iterator to) the first element in the range that is among the "largest".
ok ty
After you have found the first one, you can then repeatedly use std::find on the rest of the range.