VecInsertRangeFastR
- Macro
- October 8, 2025
Table of Contents
VecInsertRangeFastR
VecInsertRangeFastRDescription
Quickly insert array of items into vector, with R-value semantics. Ordering of elements is not guaranteed to be preserved. This call makes significant difference only for sufficiently large vectors and when idx is quite less than (v)->length. Insertion time is guaranteed to be constant for same data types.
Info
If copy_init is set, then vector will create it’s own copy of items.
Note
Unlike VecInsertRangeFastL, this does NOT zero out the source array after insertion regardless of copy_init settings. Use this for temporary arrays or when you need to maintain the source array.
Parameters
| Name | Direction | Description |
|---|---|---|
v | in,out | Vector to insert item into |
val | in | Array of items to be inserted |
idx | in | Index to insert item at. |
count | in | Number of items to insert. |
Success
return
Failure
Does not return
Usage example (Cross-references)
// Use VecInsertRangeFastR with a small array
VecInsertRangeFastR(&vec2, small_arr, 1, 2);
// Check vector length
- In
Insert.h:502:
/// FAILURE : Does not return on failure
///
#define VecPushFrontArrFastR(v, arr, count) VecInsertRangeFastR((v), (arr), 0, (count))
///
- In
VecInt.c:351:
values[i] = (i32)extract_u32(data, offset, size);
}
VecInsertRangeFastR(vec, values, idx, count);
}
break;