VecPushFrontL
- Macro
- October 8, 2025
Table of Contents
VecPushFrontL
VecPushFrontLDescription
Push item into vector front.
Note
Ownership trasfer takes place if vector is not creating it’s own copy of item.
Parameters
| Name | Direction | Description |
|---|---|---|
v | in,out | Vector to push item into |
lval | in | l-value to be inserted |
Success
return
Failure
Does not return
Usage example (Cross-references)
// Test VecPushFrontL
int val2 = 20;
VecPushFrontL(&vec, val2);
// Test VecInsertL
// Test VecPushFrontL memset behavior with complex structures
bool test_lvalue_memset_pushfront(void) {
WriteFmt("Testing VecPushFrontL memset with complex structures\n");
// Create a test item
// Insert with L-value semantics at the front (vector takes ownership)
VecPushFrontL(&vec, item);
// Check that the item was memset to 0
- In
Vec.Insert.c:405:
// Test VecPushFrontL
int val2 = 20;
VecPushFrontL(&vec, val2);
result = result && (val2 == 0); // Should be memset to 0