diff options
| author | mitchell <unknown> | 2020-01-06 20:20:56 -0500 |
|---|---|---|
| committer | mitchell <unknown> | 2020-01-06 20:20:56 -0500 |
| commit | f6e6731598a02121be850a17a12384090b40f1ac (patch) | |
| tree | 5df339d665458d5e6878c292b8e79055951fef4d /include/Compat.h | |
| parent | a7b57f9b5bb481c9b5b98dda13c0e9c44d26a237 (diff) | |
| download | scintilla-mirror-f6e6731598a02121be850a17a12384090b40f1ac.tar.gz | |
More synchronizing LongTerm3 with default.
Ideally this covers anything missed during the backport process.
Diffstat (limited to 'include/Compat.h')
| -rw-r--r-- | include/Compat.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 <typename T> +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<class T> T round(T arg) { |
