diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-03-30 23:08:43 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-03-30 23:08:43 -0500 |
commit | cb9fa588ba8144fcdd52ba4b83d69d93fb18066f (patch) | |
tree | 214574ca68c1551ec76e7fbb9e0263793180231d /include/fud_algorithm.hpp | |
parent | 1d357adfa19725ee69fb267a363f1fd217b1272f (diff) |
Add hash map.
Diffstat (limited to 'include/fud_algorithm.hpp')
-rw-r--r-- | include/fud_algorithm.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/fud_algorithm.hpp b/include/fud_algorithm.hpp index 01cc5d3..82e98cb 100644 --- a/include/fud_algorithm.hpp +++ b/include/fud_algorithm.hpp @@ -23,7 +23,6 @@ #include <concepts> #include <limits> -#include <type_traits> namespace fud { @@ -36,11 +35,23 @@ concept LessThanComparable = template <LessThanComparable T> inline const T& min(const T& lhs, const T& rhs) { if (lhs < rhs) { + // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) return lhs; } + // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) return rhs; } +template <LessThanComparable T> +inline const T& max(const T& lhs, const T& rhs) { + if (lhs < rhs) { + // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) + return rhs; + } + // NOLINTNEXTLINE(bugprone-return-const-ref-from-parameter) + return lhs; +} + template <std::integral T> class Iota { public: |