true if a free value was found otherwise false
Tests the findNextFree!(T)(T[], ref T) function
Case: First value is free + non-empty array
ubyte[] values = [1,2,3]; ubyte free; bool status = findNextFree(values, free); assert(status == true); assert(isPresent(values, free) == false);
Tests the findNextFree!(T)(T[], ref T) function
Case: First value is unfree + non-empty array
ubyte[] values = [0,2,3]; ubyte free; bool status = findNextFree(values, free); assert(status == true); assert(isPresent(values, free) == false);
Tests the findNextFree!(T)(T[], ref T) function
Case: Array is empty, first value should be T.init
ubyte[] values = []; ubyte free; bool status = findNextFree(values, free); assert(status == true); assert(free == ubyte.init); assert(isPresent(values, free) == false);
Given an array of values this tries to find the next free value of which is NOT present within the given array.
If the array provided is emptied then a value will always be found and will be that of T.init.