Exception, to be thrown when there was an array-related error.
Finds the index of the last match of a predicate in a haystack. The predicate is evaluated against each element.
Finds the index of the last occurrence of a needle in a haystack. The needle may be a single element (character) or an array of the same type as the haystack.
Iterates an associative array and deletes invalid entries, either if the value is in a default .init state or as per the optionally passed predicate.
Generates a truth table from a list of runtime numbers.
Generates a truth table from a list of runtime enum values.
Generates a static truth table from a list of compile-time numbers.
Generates a static truth table from a list of compile-time enum values.
Returns a unique key for the passed associative array. Reserves the key by assigning it a value.
Zeroes out the contents of an Appender.
string[int] aa; immutable key = aa.uniqueKey; assert(key > 0); assert(key in aa); assert(aa[key] == string.init); Appender!(int]) sink; sink.put(1); sink.put(2); sink.put(3); sink.zero(clear: false); assert(sink[] == [ 0, 0, 0 ]); sink.zero(clear: false, 42); assert(sink[] == [ 42, 42, 42 ]); sink.zero(); //(clear: true); assert(!sink[].length); immutable table = truthTable(1, 3, 5); assert((table.length == 6)); assert(table == [ false, true, false, true, false, true ]); enum E { a, b, c, d } const enumTable = truthTable(E.b, E.c); assert((enumTable.length == 3)); assert(enumTable == [ false, true, true, false ]); static staticTable = truthTable!(Yes.fullEnumRange, E.a, E.b); assert(is(typeof(staticTable) == bool[4])); assert(staticTable == [ true, true, false, false ]); immutable staticNumTable = truthTable!(2, 4, 6); assert(is(typeof(staticNumTable) == bool[7])); assert(staticNumTable == [ false, false, true, false, true, false, true ]);
Simple array utilities.