Is there a way to get the min and the max of a QList in Qt without using any iterator ?
Here is the code using iterator :
QList<double>::iterator min = std::min_element(listVal.begin(), listVal.end());
QList<double>::iterator max = std::max_element(listVal.begin(), listVal.end());
auto
in C++11 to avoid to writeQList<double>::iterator
) – Accidentaldouble min = *std::min_element(listVal.begin(), listVal.end());
? (assuming not empty list). – Accidental