VecPushBackArrL

Table of Contents

VecPushBackArrL

Description

Push a complete array into this vector, with L-value semantics.

Note

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

Parameters

NameDirectionDescription
vin,outVector to insert array items into.
arrinArray to be inserted.
countinNumber (non-zero) of items in array.

Success

v

Failure

Does not return on failure

Usage example (Cross-references)

    /// FAILURE : Does not return on failure
    ///
    #define VecPushBackArr(v, arr, count) VecPushBackArrL((v), (arr), (count))
    
    ///
    #define VecMergeL(v, v2)                                                                                               \
    do {                                                                                                               \
    VecPushBackArrL((v), (v2)->data, (v2)->length);                                                                \
    /* Free the source vector's data and reset its state */                                                        \
    if ((v2)->data) {                                                                                              \
    // Test array operations
    int arr[] = {40, 50, 60};
    VecPushBackArrL(&vec, arr, 3);
    
    // Check that array elements are memset to 0
    
    // Test VecPushBackArrL
    VecPushBackArrL(&vec, arr, 3);
    
    // Check vector length
    
    // Test VecPushBackArrL
    VecPushBackArrL(&vec, items, 3);
    
    // Check that all items were memset to 0

Share :