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

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


Definition

constexpr T pop() &
noexcept(xte::is_noex_move_constructible<T>)
requires(xte::is_move_constructible<T>);
Erases the last element from the array and returns it, but the result may be discarded.



Example

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