Skip to content

Commit 3b7d12b

Browse files
RTriouxalandefreitas
authored andcommitted
Prevent compilation errors because of dangling references with std::minmax
1 parent 88e0a86 commit 3b7d12b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/matplot/util/contourc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,8 @@ namespace matplot {
19821982
double zmin = z[0][0];
19831983
double zmax = z[0][0];
19841984
for (const auto &z_row : z) {
1985-
auto [minit, maxit] = std::minmax(z_row.begin(), z_row.end());
1985+
auto [minit, maxit] =
1986+
std::minmax_element(z_row.begin(), z_row.end());
19861987
if (*minit < zmin) {
19871988
zmin = *minit;
19881989
}

0 commit comments

Comments
 (0)