summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-13 06:05:26 +0100
committeraura <nw@moneybot.cc>2026-03-13 06:05:26 +0100
commit59ca7ecafca84fa62ee8d54d0e48521b7e4c0a95 (patch)
tree63f3a870116befa13cc4db005ce8ac7d717ed9aa /src
parentd42d218a3685c030a7370d30f2de5495ea526d99 (diff)
upgrade to c++20 bcuz why not
Diffstat (limited to 'src')
-rw-r--r--src/editor/properties.h9
-rw-r--r--src/util/allocator.h1
2 files changed, 5 insertions, 5 deletions
diff --git a/src/editor/properties.h b/src/editor/properties.h
index f3d55b5..34ac765 100644
--- a/src/editor/properties.h
+++ b/src/editor/properties.h
@@ -1,6 +1,7 @@
#pragma once
#include "../gamedef.h"
+#include <concepts>
#if IS_EDITOR
#include <math.h>
@@ -44,6 +45,9 @@ struct EOBJECT {
LIST<struct EDITOR_PROP*> eprops{};
};
+template <typename T>
+concept __eobject_base = __is_base_of(EOBJECT, T);
+
// editor object property
struct EDITOR_PROP {
void* pdata;
@@ -68,16 +72,13 @@ struct EDITOR_PROP {
template <> struct __eprop_type<F32> { static const U8 type = EPROP_F32; };
template <> struct __eprop_type<F64> { static const U8 type = EPROP_F64; };
template <> struct __eprop_type<STR> { static const U8 type = EPROP_STRING; };
- template <> struct __eprop_type<EOBJECT> { static const U8 type = EPROP_OBJ; };
+ template <__eobject_base T> struct __eprop_type<T> { static const U8 type = EPROP_OBJ; };
template <typename LT> struct __eprop_type<LIST<LT>> { static const U8 type = EPROP_LIST; };
template <> struct __eprop_type<LIST<struct MAP_TEXTURE_ENTRY*>> { static const U8 type = EPROP_TEXTURE_LIST; };
};
template <typename T>
const U8 eprop_type() {
- if constexpr( __is_base_of( EOBJECT, T ) )
- return EPROP_OBJ;
-
return EDITOR_PROP::__eprop_type<T>::type;
}
#else
diff --git a/src/util/allocator.h b/src/util/allocator.h
index 0cb8fa2..ff3d3c5 100644
--- a/src/util/allocator.h
+++ b/src/util/allocator.h
@@ -83,7 +83,6 @@ struct LIST {
capacity = _size;
}
-
LIST( const LIST<T>& other ) {
if( this == &other ) return;