a9c943bef9
This PR implements range iterators in the base containers (Vector, Map, List, Pair Set). Given several of these data structures will be replaced by more efficient versions, having a common iterator API will make this simpler. Iterating can be done as follows (examples): ```C++ //Vector<String> for(const String& I: vector) { } //List<String> for(const String& I: list) { } //Map<String,int> for(const KeyValue<String,int>&I : map) { print_line("key: "+I.key+" value: "+itos(I.value)); } //if intending to write the elements, reference can be used //Map<String,int> for(KeyValue<String,int>& I: map) { I.value = 25; //this will fail because key is always const //I.key = "hello" } ``` The containers are (for now) not STL compatible, since this would mean changing how they work internally (STL uses a special head/tail allocation for end(), while Godot Map/Set/List do not). The idea is to change the Godot versions to be more compatible with STL, but this will happen after conversion to new iterators have taken place. |
||
---|---|---|
.. | ||
bin_sorted_array.h | ||
command_queue_mt.cpp | ||
command_queue_mt.h | ||
cowdata.h | ||
hash_map.h | ||
hashfuncs.h | ||
list.h | ||
local_vector.h | ||
lru.h | ||
map.h | ||
oa_hash_map.h | ||
ordered_hash_map.h | ||
paged_allocator.h | ||
paged_array.h | ||
pair.h | ||
pass_func.h | ||
pooled_list.h | ||
rid_owner.cpp | ||
rid_owner.h | ||
rid.h | ||
ring_buffer.h | ||
safe_refcount.h | ||
SCsub | ||
self_list.h | ||
set.h | ||
simple_type.h | ||
sort_array.h | ||
thread_work_pool.cpp | ||
thread_work_pool.h | ||
vector.h | ||
vmap.h | ||
vset.h |