From 426755eb6f3efe653ee153cdf96bdced5d893ef0 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Tue, 2 May 2017 23:23:37 +0200 Subject: [PATCH] Comment on std::clamp --- dune/solvers/common/interval.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dune/solvers/common/interval.hh b/dune/solvers/common/interval.hh index 69524020..f46d1599 100644 --- a/dune/solvers/common/interval.hh +++ b/dune/solvers/common/interval.hh @@ -61,6 +61,9 @@ public: */ field_type projectIn(const field_type& x) const { + // NB: C++17 has std::clamp(x, data_[0], data_[1]). + // Note, however, that we need to guarantee neither + // data_[0] nor data_[1] is NaN then. return std::max(std::min(x,data_[1]), data_[0]); } -- GitLab