Skip to content

VecPushFrontL

VecPushFrontL

Description

Push item into vector front.

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)

Usage examples (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
        // Test VecPushFrontL
        int val2 = 20;
        VecPushFrontL(&vec, val2);
        result = result && (val2 == 0); // Should be memset to 0
Last updated on