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

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


Definition

[[nodiscard]] constexpr xte::array<T> subrange(this auto&&, xte::uz index, xte::uz size = -1uz) const noexcept(false);
Returns a subrange of copied or moved elements.



Example

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