Skip to content
VecPushBackArrL

VecPushBackArrL

VecPushBackArrL

Description

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

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

Parameters

Name Direction Description
v in,out Vector to insert array items into.
arr in Array to be inserted.
count in Number (non-zero) of items in array.

Success

v

Failure

Does not return on failure

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 memset to 0
        // Test array operations
        int arr[] = {40, 50, 60};
        VecPushBackArrL(&vec, arr, 3);
    
        // Check that array elements are memset to 0
    /// FAILURE : Does not return on failure
    ///
    #define VecPushBackArr(v, arr, count) VecPushBackArrL((v), (arr), (count))
    
    ///
        do {                                                                                                               \
            if ((v2)->data) {                                                                                              \
                VecPushBackArrL((v), (v2)->data, (v2)->length);                                                            \
                if (!(v)->copy_init && (v2)->data) {                                                                       \
                    free((v2)->data);                                                                                      \
Last updated on