summaryrefslogtreecommitdiff
path: root/include/fud_algorithm.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2025-01-01 17:41:17 -0600
committerDominick Allen <djallen@librehumanitas.org>2025-01-01 17:41:17 -0600
commit16379362c02a2472f00fac49cad62788547c9519 (patch)
tree9b7f42acbba8dd259a536287a2b130e92ad2e2c7 /include/fud_algorithm.hpp
parent012df4bc38777c9053353ec2c4213bba67d63ab4 (diff)
Add CSV parsing, printing, fix buffered file reading.
Diffstat (limited to 'include/fud_algorithm.hpp')
-rw-r--r--include/fud_algorithm.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/fud_algorithm.hpp b/include/fud_algorithm.hpp
index 0ad71d5..01cc5d3 100644
--- a/include/fud_algorithm.hpp
+++ b/include/fud_algorithm.hpp
@@ -27,6 +27,20 @@
namespace fud {
+template<typename T>
+concept LessThanComparable =
+ requires(T lhs, T rhs) {
+ { lhs < rhs } -> std::convertible_to<bool>;
+};
+
+template <LessThanComparable T>
+inline const T& min(const T& lhs, const T& rhs) {
+ if (lhs < rhs) {
+ return lhs;
+ }
+ return rhs;
+}
+
template <std::integral T>
class Iota {
public: