[solved]using part of list in std::max_element function
-
I use max_element to find maximum element of list
QList<float> list;
list << 1 << 2.2 << 3.5 << 4.6 << 7 << 13 << 15 << 35.82 << 0 << 12 << 8.34 << 23;
QList<float>::iterator it = std::max_element(l.begin(), l.end());Is there a way to find maximum element of part of list. For example between list[5] and list[10] ?
-
Hi,
Something like:
QList<float>::iterator it = std::max_element(myList.begin() + 5, myList.begin() + 10)
?
-
exactly. thank you.