std::inplace_vector<T,N>::append_range

Inserts copies of elements from the range rg before end(), in non-reversing order.

# Declarations

template< container-compatible-range<T> R >
constexpr void append_range( R&& rg );

(since C++26)

# Parameters

# Return value

(none)

# Example

#include <cassert>
#include <inplace_vector>
#include <iostream>
 
int main()
{
    using I = std::inplace_vector<int, 8>;
    auto head = I{1, 2, 3, 4};
    const auto tail = {-5, -6, -7};
    head.append_range(tail);
    assert(head.size() == 7 and (head == I{1, 2, 3, 4, -5, -6, -7}));
    try
    {
        head.append_range(tail); // throws: no space
    }
    catch(const std::bad_alloc&)
    {
        std::cout << "std::bad_alloc\n";
    }
}

# See also