xte ::array <T >::insert_range ()
Defined in header <xte/data/array.hpp> Definition
Copies qualifiers fromtemplate <std ::ranges ::input_range Range =xte ::array <T >>constexpr void insert_range (xte ::uz index ,Range && range )& noexcept (false )requires (/* See below */ );
Range onto its element type. Inserts elements from the given range at the given index, shifting existing elements back. If Range satisfies std ::ranges ::sized_range <> and the range's elements fit within the currently allocated uninitialized elements, then reallocation is not performed. Requires that T is constructible from the range's elements and is move-assignable.Example
Output:xte ::array array = {1 ,2 ,3 };array .insert_range (1 , {4 ,5 ,6 });std ::println ("{}" ,array );
[View in Compiler Explorer][1, 4, 5, 6, 2, 3]