summaryrefslogtreecommitdiff
path: root/deimos/core/base.h
diff options
context:
space:
mode:
Diffstat (limited to 'deimos/core/base.h')
-rw-r--r--deimos/core/base.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/deimos/core/base.h b/deimos/core/base.h
index 21cad3d..4bcb7c7 100644
--- a/deimos/core/base.h
+++ b/deimos/core/base.h
@@ -53,6 +53,14 @@ struct SourceLocation
{}
};
+template<typename T> T Min(T a, T b) { return (a < b) ? a : b; }
+template<typename T> T Max(T a, T b) { return (a > b) ? a : b; }
+
+constexpr void MemoryCopy(void* dst, const void* src, int64_t size)
+{
+ __builtin_memcpy(dst, src, (size_t)size);
+}
+
template<typename T>
class Span
{
@@ -79,7 +87,7 @@ public:
template<typename U>
requires std::convertible_to<U*, T*>
- constexpr Span(const Span<U>& other) : // NOLINT
+ constexpr Span(const Span<U>& other) : // NOLINT(*-explicit-conversions)
m_begin{other.begin()},
m_size{other.size()}
{}