diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-04 22:05:06 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2024-04-04 22:05:06 +0200 |
commit | f3ba19b162a89b2081c0598b4a0bf126146e3671 (patch) | |
tree | e6c82af3ad5c7ea5e11aa6381822bfc8e68dd5fd /deimos/core/base.h | |
parent | 3320960992afe36f4b6306130c6327e084c381b2 (diff) |
Add logging system
Diffstat (limited to 'deimos/core/base.h')
-rw-r--r-- | deimos/core/base.h | 10 |
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()}
{}
|