xte::array<T>::push()

Defined in header <xte/data/array.hpp>


Definitions

#0
constexpr auto push() & XTE_ARROW(
	this->insert(-1uz)
)
Default-constructs an element at the end of the array.

#1
template<typename U = T>
constexpr auto push(U&& arg, auto&&... args) & XTE_ARROW(
	this->insert(-1uz, XTE_FWD(arg), XTE_FWD(args)...)
)
Constructs an element at the end of the array with the provided arguments.



Example

xte::array array = { 1, 2, 3 };
array.push(4);
std::println("{}", array);
Output:
[1, 2, 3, 4]
[View in Compiler Explorer]