VecPushFrontL

Table of Contents

VecPushFrontL

Description

Push item into vector front.

Note

Ownership trasfer takes place if vector is not creating it’s own copy of item.

Parameters

NameDirectionDescription
vin,outVector to push item into
lvalinl-value to be inserted

Success

return

Failure

Does not return

Usage example (Cross-references)

    // Test VecPushFrontL
    int val2 = 20;
    VecPushFrontL(&vec, val2);
    result = result && (val2 == 0); // Should be memset to 0
    // Test VecPushFrontL
    int val2 = 20;
    VecPushFrontL(&vec, val2);
    
    // Test VecInsertL
    // Test VecPushFrontL memset behavior with complex structures
    bool test_lvalue_memset_pushfront(void) {
    printf("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

Share :