Iteration

ListForeach

ListForeach Description Iterate over each element var of the given list l. The variable var is declared and defined by this macro. Iteration happens in forward order, starting from the head of the list and continuing through the next pointers until the end is reached. The variable var will contain a copy of the value pointed to by each list node.

Read More

ListForeachIdx

ListForeachIdx Description Iterate over each element var of the given list l, with index idx. The variable var is declared and defined by this macro. Iteration happens in forward order, starting from the head of the list. This macro also tracks the index (idx) of each element during iteration. var will contain a copy of the value pointed to by each list node, and idx will be the zero-based index of the current element.

Read More

ListForeachInRange

ListForeachInRange Description Iterate over each element var of the given list l in the index range [start, end). The variable var is declared and defined by this macro. This macro performs forward traversal, starting at index start (inclusive) and continuing until index end (exclusive), assuming zero-based indexing. Since linked lists are not indexable, the traversal walks node-by-node and skips nodes before start, then continues while tracking the current index.

Read More

ListForeachPtr

ListForeachPtr Description Iterate over each element var (as a pointer) of the given list l. The variable var is declared and defined by this macro as a pointer to the list’s data type. Iteration happens in forward order, starting from the head of the list and continuing through the next pointers until the end is reached. The variable var will point to the data associated with each list node.

Read More

ListForeachPtrIdx

ListForeachPtrIdx Description Iterate over each element var (as a pointer) of the given list l, with index idx. The variable var is declared and defined by this macro as a pointer to the data. Iteration happens in forward order, starting from the head of the list. This macro also tracks the index (idx) of each element during iteration. var will point to the data associated with the current list node, and idx will be the zero-based index of the current element.

Read More

ListForeachPtrInRange

ListForeachPtrInRange Description This macro performs forward traversal, starting at index start (inclusive) and continuing until index end (exclusive), assuming zero-based indexing. Since linked lists are not indexable, the traversal walks node-by-node and skips nodes before start, then continues while tracking the current index.

Read More

ListForeachPtrReverse

ListForeachPtrReverse Description Iterate over each element var (as a pointer) of the given list l in reverse order. The variable var is declared and defined by this macro as a pointer to the list’s data type. Iteration happens in reverse, starting from the tail of the list and continuing through the prev pointers until the head is reached. The variable var will point to the data associated with each list node.

Read More

ListForeachPtrReverseIdx

ListForeachPtrReverseIdx Description Iterate over each element var of the given list l in reverse order, with index idx. The variable var is declared and defined by this macro. Iteration starts from the tail and moves backward using the prev pointers. The variable idx will contain the zero-based index from the head: index length-1 corresponds to the tail, length-2 to the previous node, and so on down to 0 (head).

Read More

ListForeachPtrReverseInRange

ListForeachPtrReverseInRange Description Iterate over each element var (as a pointer) of the given list l in reverse, limited to index range [start, end) relative to the tail of the list. Index 0 corresponds to the tail, 1 to the previous node, and so on. The variable var is declared and defined by this macro as a pointer to the list’s data type. Since linked lists do not support indexing, this macro counts nodes from the tail and includes only those where the relative reverse index lies in [start, end).

Read More

ListForeachReverse

ListForeachReverse Description Iterate over each element var of the given list l in reverse order. The variable var is declared and defined by this macro. Iteration happens in reverse, starting from the tail of the list and continuing through the prev pointers until the head is reached. The variable var will contain a copy of the value pointed to by each list node.

Read More

ListForeachReverseIdx

ListForeachReverseIdx Description Iterate over each element var of the given list l in reverse order, with index idx. The variable var is declared and defined by this macro. Iteration starts from the tail and moves backward using the prev pointers. The variable idx will contain the zero-based index from the head: index length-1 corresponds to the tail, length-2 to the previous node, and so on down to 0 (head).

Read More

ListForeachReverseInRange

ListForeachReverseInRange Description Iterate over each element var of the given list l in reverse, limited to index range [start, end) relative to the tail of the list. Index 0 corresponds to the tail, 1 to the previous node, and so on. The variable var is declared and defined by this macro. Since linked lists do not support indexing, this macro counts nodes from the tail and includes only those where the relative reverse index lies in [start, end).

Read More

VecForeach

VecForeach Description Iterate over each element var of the given vector v. This is a convenience macro that iterates forward using an internally managed index. The variable var is declared and defined by this macro.

Read More

VecForeachIdx

VecForeachIdx Description Iterate over each element var of given vector v at each index idx into the vector. The variables var and idx declared and defined by this macro. idx will start from 0 and will go till v->length - 1

Read More

VecForeachInRange

VecForeachInRange Description Iterate over elements in a specific range of the given vector v. This is a convenience macro that iterates over a range using an internally managed index. The variable var is declared and defined by this macro.

Read More

VecForeachInRangeIdx

VecForeachInRangeIdx Description Iterate over elements in a specific range of the given vector v at each index idx. The variables var and idx are declared and defined by this macro. idx will start from start and will go till end - 1

Read More

VecForeachPtr

VecForeachPtr Description Iterate over each element var of the given vector v (as a pointer). This is a convenience macro that iterates forward using an internally managed index and provides a pointer to each element. The variable var is declared and defined by this macro as a pointer to the vector’s data type.

Read More

VecForeachPtrIdx

VecForeachPtrIdx Description Iterate over each element var of given vector v at each index idx into the vector. The variables var and idx declared and defined by this macro. idx will start from 0 and will go till v->length - 1

Read More

VecForeachPtrInRange

VecForeachPtrInRange Description Iterate over elements in a specific range of the given vector v (as pointers). This is a convenience macro that iterates over a range using an internally managed index and provides a pointer to each element. The variable var is declared and defined by this macro as a pointer to the vector’s data type.

Read More

VecForeachPtrInRangeIdx

VecForeachPtrInRangeIdx Description Iterate over elements in a specific range of the given vector v at each index idx (as pointers). The variables var and idx are declared and defined by this macro. idx will start from start and will go till end - 1

Read More

VecForeachPtrReverse

VecForeachPtrReverse Description Iterate over each element var (as a pointer) of the given vector v in reverse order. This is a convenience macro that iterates backward using an internally managed index and provides a pointer to each element. The variable var is declared and defined by this macro as a pointer to the vector’s data type.

Read More

VecForeachPtrReverseIdx

VecForeachPtrReverseIdx Description Iterate over each element var of given vector v at each index idx into the vector. The variables var and idx declared and defined by this macro. idx will start from v->length - 1 and will go till 0

Read More

VecForeachReverse

VecForeachReverse Description Iterate over each element var of the given vector v in reverse order. This is a convenience macro that iterates backward using an internally managed index. The variable var is declared and defined by this macro.

Read More

VecForeachReverseIdx

VecForeachReverseIdx Description Iterate over each element var of given vector v at each index idx into the vector. The variables var and idx declared and defined by this macro. idx will start from v->length - 1 and will go till 0

Read More