aboutsummaryrefslogtreecommitdiff
path: root/src/containers.hh
diff options
context:
space:
mode:
authorfusion32 <marcopuzziello@gmail.com>2025-06-17 03:13:05 -0300
committerfusion32 <marcopuzziello@gmail.com>2025-06-17 03:13:05 -0300
commit56bdec57609cd00d7827a3008a9c6b06707097ca (patch)
tree08e42a536bf807842de299047195c9ecf5d526ae /src/containers.hh
parent0612480d9beb19b9e90b3a4f1198b3da1fd21f6a (diff)
downloadgame-56bdec57609cd00d7827a3008a9c6b06707097ca.tar.gz
game-56bdec57609cd00d7827a3008a9c6b06707097ca.zip
all `crplayer.cc` functions outside `TPlayer`
Diffstat (limited to 'src/containers.hh')
-rw-r--r--src/containers.hh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/containers.hh b/src/containers.hh
index ecbe6be..1ff9896 100644
--- a/src/containers.hh
+++ b/src/containers.hh
@@ -532,7 +532,9 @@ union storeitem{
// IMPORTANT(fusion): This will only work properly with POD structures. We
// could also manually handle `data` construction and destruction but I don't
// think we need it.
- STATIC_ASSERT(std::is_pod<T>::value);
+ STATIC_ASSERT(std::is_trivially_default_constructible<T>::value
+ && std::is_trivially_destructible<T>::value
+ && std::is_trivially_copyable<T>::value);
storeitem<T> *next;
T data;
};
@@ -560,7 +562,7 @@ struct store{
T *getFreeItem(void){
if(this->firstFreeItem == NULL){
- storeunit<T, N> *Unit = &this->Units.append()->data;
+ storeunit<T, N> *Unit = &this->Units->append()->data;
for(usize i = 0; i < (N - 1); i += 1){
Unit->item[i].next = &Unit->item[i + 1];
}
@@ -577,7 +579,7 @@ struct store{
// TODO(fusion): Not the safest thing to do.
ASSERT(Item != NULL);
((storeitem<T>*)Item)->next = this->firstFreeItem;
- this->firstfreeItem = (storeitem<T>*)Item;
+ this->firstFreeItem = (storeitem<T>*)Item;
}
// DATA