summaryrefslogtreecommitdiff
path: root/asl/utility.hpp
diff options
context:
space:
mode:
authorSteven Le Rouzic <steven.lerouzic@gmail.com>2024-11-19 00:08:33 +0100
committerSteven Le Rouzic <steven.lerouzic@gmail.com>2024-12-20 15:35:58 +0100
commitd241eaf1b209dcfb05656842dd6250067b704d99 (patch)
tree49f34f6226f4614611d16ba6332b1b50b51a4712 /asl/utility.hpp
parent58200ce939a591008a8d9406f437252ce2b175cf (diff)
Add allocator, start work on box
Diffstat (limited to 'asl/utility.hpp')
-rw-r--r--asl/utility.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/asl/utility.hpp b/asl/utility.hpp
index d54d965..7740eff 100644
--- a/asl/utility.hpp
+++ b/asl/utility.hpp
@@ -24,6 +24,12 @@ constexpr U bit_cast(T value) requires (size_of<T> == size_of<U>)
return __builtin_bit_cast(U, value);
}
+template<typename T>
+T min(T a, T b)
+{
+ return (a <= b) ? a : b;
+}
+
#define ASL_DELETE_COPY(T) \
T(const T&) = delete; \
T& operator=(const T&) = delete;