From f6e6731598a02121be850a17a12384090b40f1ac Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 6 Jan 2020 20:20:56 -0500 Subject: More synchronizing LongTerm3 with default. Ideally this covers anything missed during the backport process. --- include/Compat.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/Compat.h b/include/Compat.h index d69a9a2c1..b4a9437c2 100644 --- a/include/Compat.h +++ b/include/Compat.h @@ -14,6 +14,12 @@ namespace Sci { +// std::clamp +template +inline constexpr T clamp(T val, T minVal, T maxVal) { + return (val > maxVal) ? maxVal : ((val < minVal) ? minVal : val); +} + // std::round (not present on older MacOSX SDKs) template T round(T arg) { -- cgit v1.2.3