Skip to content
VecPushBackArrR

VecPushBackArrR

VecPushBackArrR

Description

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

Unlike VecPushBackArrL, this does NOT zero out the source array after insertion.

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)
                        values[i] = (i32)extract_u32(data, offset, size);
                    }
                    VecPushBackArrR(vec, values, count);
                }
                break;
    
        // Clone the source vector into the destination
        VecPushBackArrR(&clone, src.data, src.length);
    
        // Check that the clone has the same data but different memory
        // Add some initial elements
        int values[] = {10, 20, 30, 40, 50, 60, 70, 80, 90};
        VecPushBackArrR(&vec, values, 9);
    
        // Test VecDelete (regular delete)
    
        // Add elements again
        VecPushBackArrR(&vec, values, 9);
    
        // Test VecDeleteFast (fast delete)
    
        // Add elements again
        VecPushBackArrR(&vec, values, 9);
    
        // Create an L-value index to use with regular VecDelete
        // Create a small array and use count=0
        int small_arr[1] = {42};
        VecPushBackArrR(&vec, small_arr, 0);
        result = result && (vec.length == 1); // Length should not change
        // Push an array to the back
        int values[] = {10, 20, 30, 40, 50};
        VecPushBackArrR(&vec, values, 5);
    
        // Check length
        // Push another array to the back
        int more_values[] = {60, 70, 80};
        VecPushBackArrR(&vec, more_values, 3);
    
        // Check length
        // Add some initial elements
        int initial[] = {10, 20, 30};
        VecPushBackArrR(&vec, initial, 3);
    
        // Create another vector with elements to insert
        IntVec src          = VecInit();
        int    src_values[] = {40, 50, 60};
        VecPushBackArrR(&src, src_values, 3);
    
        // Insert range in the middle
        // Add some elements to first vector
        int values1[] = {10, 20, 30};
        VecPushBackArrR(&vec1, values1, 3);
    
        // Create second vector
        // Add some elements to second vector
        int values2[] = {40, 50, 60};
        VecPushBackArrR(&vec2, values2, 3);
    
        // Merge vec2 into vec1
    
        // R-value array operations
        VecPushBackArrR(&vec, arr, 3);
    
        // Check that the elements were added
        do {                                                                                                               \
            if ((v2)->data) {                                                                                              \
                VecPushBackArrR((v), (v2)->data, (v2)->length);                                                            \
            }                                                                                                              \
        } while (0)
    /// FAILURE : NULL
    ///
    #define StrPushBackCstr(str, cstr, len) VecPushBackArrR((str), (cstr), (len))
    
    ///
Last updated on