VecInsert

Table of Contents

VecInsert

Description

Insert by default behaves like VecInsertL, which is to insert an l-value into vector and then take ownership if vector does not have a copy-init method.

Parameters

NameDirectionDescription
vin,outVector to insert item into
lvalinl-value to be inserted
idxinIndex to insert item at.

Success

return

Failure

Does not return

Usage example (Cross-references)

    /// FAILURE : Does not return
    ///
    #define VecPushBack(v, val) VecInsert((v), (val), (v)->length)
    
    ///
    // Test VecInsert function
    bool test_vec_insert(void) {
    printf("Testing VecInsert\n");
    
    // Create a vector of integers

Share :