UnrolledList.get

Get item at some position.

To be @nogc it do not throw, but return tuple with bool okmember.

struct UnrolledList(T, Allocator = Mallocator, bool GCRangesAllowed = true)
get
(
size_t i
)

Parameters

i size_t

position

Return Value

Type: auto

tuple with succes indicator and value

UnrolledList!int l;
foreach(i; 0..50)
{
    l.pushBack(i);
}
auto v = l.get(25);
assert(v.ok);
assert(v.value == 25);

Meta