fixedsizearray 1.2.0

A fixed size array implementation


To use this package, run the following command in your project's root directory:

Fixedsizearray

A fixed size array that has a bunch of useful helper functions

Example

FixedSizeArray!(int, 10) fsa;
assert(fsa.empty);

fsa.insertBack(1);
assert(fsa.front == 1);
assert(fsa.back == 1);
assert(fsa[0] == 1);

fsa.insertFront(0);
assert(fsa.front == 0);
assert(fsa.back == 1);
assert(fsa[0] == 0);
assert(fsa[1] == 1);

int idx = 0;
foreach(it; fsa[0 .. fsa.length]) {
	assert(it == idx);
	++idx;
}

fsa.removeFront();
assert(fsa.front == 1);
assert(fsa.back == 1);
assert(fsa[0] == 1);

fsa.removeBack();
assert(fsa.empty);
Authors:
  • burner
Dependencies:
exceptionhandling
Versions:
1.2.0 2019-Feb-20
1.1.1 2017-Sep-17
1.1.0 2017-Jun-12
1.0.6 2017-Apr-05
1.0.5 2017-Mar-09
Show all 15 versions
Download Stats:
  • 0 downloads today

  • 4 downloads this week

  • 27 downloads this month

  • 1469 downloads total

Score:
0.8
Short URL:
fixedsizearray.dub.pm