The This alias for the type of this struct
Predicate that checks whether the specified value is inside this range.
Predicate that checks whether this range is covered by the given array of ranges (i.e. whether it is a subset of the union of the array of ranges).
Determines whether this instance is non-empty subset of the specified range. All values in this range must be within the other range.
Determines whether this instance is a superset of the non-empty specified range. All values in the other range must be within this range.
Predicate that checks whether the provided array of ranges exactly tessellates this range. The term "tessellation" means that this range is a union of the given ranges and that the given ranges form a contiguous chain without gap or overlap.
Note that in non-release builds, the struct invariant ensures that instances are always valid. This method can be called by user code to explicitly check the validity of a range, for example when creating a range from run-time data.
Sets the maximum value of the range.
Sets the minimum value of the range.
Compares this instance with rhs. An empty range is considered to be < all non-empty ranges. Otherwise, the comparison always considers the range's minimum value before comparing the maximum value.
Checks whether the specified range is exactly identical to this range.
Calculates the number of values shared by this range and the other range specified.
Checks whether this range shares any values with the other range specified.
Subtracts the specified range from this range, returning the remaining range(s) via the out parameters. Two separate ranges can result from a subtraction if the range being subtracted bisects the range being subtracted from, like:
The range must always be valid.
Checks whether the specified range is empty.
Checks whether the specified range is the full range of T.
Checks whether the specified range is valid.
Range factory which provides extended wrapper to opCall. It returns empty range when min > max or when it is impossible to respect the specified boundaries.
Static opCall. Disables the default "constructor", with the advantage that the invariant is run after calling this method, making it impossible to construct invalid instances.
Unittest to instantiate the Range template with all supported types, in turn running the unittests for each of them.
Range!(ubyte) br; Range!(ushort) sr; Range!(ulong) lr;
Range struct template