-
Notifications
You must be signed in to change notification settings - Fork 3
array(English)
myyrakle edited this page Jan 30, 2019
·
1 revision
#define decl_array(declname, type, length)
struct declname;
- type data[length]
Method names | Description |
---|---|
Capacity | |
get_length | return length of array |
Element Access | |
get | return element corresponding to the index |
get_ptr | return pointer of element corresponding to the index |
get_cptr | return const pointer of element corresponding to the index |
Non-modifying Operation | |
clone | return self after deep copy |
Iterators | |
begin | return iterator to the beginning |
end | return iterator pointing to the end |
Linear Search | |
find | find a specific value and return the iterator in that location |
find_by | find the value that a specific function return true, and return the iterator in that location |
indexof | find a specific value and return that index |
indexof_by | find the value that a specific function return true, and return the index |
contains | return true if it contains a specific value |
contains_by | return true if it contains the value that a specific function return true |
Binary Search | |
bfind | binary search find a specific value and return the iterator in that location |
bfind_by | binary search find the value that a specific function return true, and return the iterator in that location |
bindexof | binary search find a specific value and return that index |
bindexof_by | binary search find the value that a specific function return true, and return the index |
bcontains | return true if it contains a specific value. using binary search |
bcontains_by | return true if it contains the value that a specific function return true. using binary search |
Modifying Operation | |
fill | fill array with a specific value |
fill_ptr | fill array with a specific value pointer |
Sorting Operation | |
sort | sort array |
sort_by | sort array by compare function |
Range | |
for_each | call a specific function while iterate all the elements |
for_each_ptr | call a specific function while iterate all the elements by the pointer |