getAlways method
This will always return an element unless the list is empty. In case of overflow, the list will repeat.
Implementation
T getAlways(int index) {
assert(isNotEmpty, "List should be empty");
return this[index % length];
}
This will always return an element unless the list is empty. In case of overflow, the list will repeat.
T getAlways(int index) {
assert(isNotEmpty, "List should be empty");
return this[index % length];
}