fixes on containers (compiles but still verifying parity with c++ templates

I'm going to have to change some c++ templates to match the init interfaces as they must not be in the return type
This commit is contained in:
2024-12-05 17:48:24 -05:00
parent a3407c14d5
commit 8bb2bc7b1b
7 changed files with 66 additions and 60 deletions

View File

@ -73,11 +73,11 @@ struct Array
forceinline static Array init_reserve(AllocatorInfo allocator, ssize capacity) { return GEN_NS array_init_reserve<Type>(allocator, capacity); }
forceinline static usize grow_formula(ssize value) { return GEN_NS array_grow_formula<Type>(value); }
forceinline bool append(Array other) { return GEN_NS array_append<Type>(this, other); }
forceinline bool append(Array other) { return GEN_NS array_append_array<Type>(this, other); }
forceinline bool append(Type value) { return GEN_NS array_append<Type>(this, value); }
forceinline bool append(Type* items, usize item_num) { return GEN_NS array_append<Type>(this, items, item_num); }
forceinline bool append(Type* items, usize item_num) { return GEN_NS array_append_items<Type>(this, items, item_num); }
forceinline bool append_at(Type item, usize idx) { return GEN_NS array_append_at<Type>(this, item, idx); }
forceinline bool append_at(Type* items, usize item_num, usize idx) { return GEN_NS array_append_at<Type>(this, items, item_num, idx); }
forceinline bool append_at(Type* items, usize item_num, usize idx) { return GEN_NS array_append_items_at<Type>(this, items, item_num, idx); }
forceinline Type* back() { return GEN_NS array_back<Type>(* this); }
forceinline void clear() { GEN_NS array_clear<Type>(* this); }
forceinline bool fill(usize begin, usize end, Type value) { return GEN_NS array_fill<Type>(* this, begin, end, value); }

View File

@ -1,5 +1,6 @@
#ifdef GEN_INTELLISENSE_DIRECTIVES
# pragma once
# include "parsing.hpp"
#endif
#pragma region ADT
@ -42,7 +43,7 @@ u8 adt_destroy_branch( ADT_Node* node )
adt_destroy_branch( node->nodes + i );
}
array_free(& node->nodes);
array_free(node->nodes);
}
return 0;
}
@ -288,7 +289,7 @@ ADT_Node* adt_alloc_at( ADT_Node* parent, ssize index )
ADT_Node o = { 0 };
o.parent = parent;
if ( ! array_append_at( & parent->nodes, o, index ) )
if ( ! array_append_at( parent->nodes, o, index ) )
return NULL;
ADT_Node* node = & parent->nodes[index];