VecPushBackArrL
Description
Append a contiguous range of elements to the end of the vector. L-value form takes ownership of the source on success when the vector has no copy_init handler.
Parameters
| Name | Direction | Description |
|---|---|---|
v |
in,out | Vector handle. |
arr |
in | Pointer to the source array. |
count |
in | Number of elements to append. |
Success
Returns true. The vector length grows by count; the appended elements occupy [old_length, new_length). When the vector has no copy_init handler, the count * sizeof(element) source bytes have been zeroed.
Failure
Returns false on allocation failure. Both vector and source are unchanged.
Usage example (Cross-references)
Usage examples (Cross-references)
// Test VecPushBackArrL
VecPushBackArrL(&vec, arr, 3);
// Check vector length
// Test VecPushBackArrL
VecPushBackArrL(&vec, items, 3);
// Check that all items were zeroed
- In
Vec.Insert.c:463:
// Test array operations
int arr[] = {40, 50, 60};
VecPushBackArrL(&vec, arr, 3);
// Check that array elements are zeroed
- In
Insert.h:295:
/// TAGS: Vec, PushBack, Range, Insert
///
#define VecPushBackArr(v, arr, count) VecPushBackArrL((v), (arr), (count))
///
- In
Insert.h:761:
#define VecMustPushBackArrL(v, arr, count) \
do { \
if (!VecPushBackArrL((v), (arr), (count))) { \
LOG_FATAL("VecMustPushBackArrL failed"); \
} \- In
Insert.h:637:
/// TAGS: Str, PushBack, Range, LValue
///
#define StrPushBackArrL(str, arr, count) VecPushBackArrL((str), (arr), (count))
///
Last updated on