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

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


Definition

[[nodiscard]] constexpr xte::array<T> slice(xte::uz index, xte::uz size = -1uz) const noexcept(false);
Returns the number of stored elements.



Example

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