nxt.range_ex

Extensions to std.range.

Public Imports

nxt.slicing
public import nxt.slicing;

Members

Functions

adjacentTuples
auto adjacentTuples(R r)

Return: Adjacent N-Tuples of r.

asTuple
auto asTuple(T[n] arr)

Return Static Array arr as a Tuple.

backPop
ElementType!R backPop(R r)

Steal back from r destructively and return it.

frontPop
ElementType!R frontPop(R r)

Steal front from r destructively and return it.

iotaOf
auto iotaOf(B begin, E end, S step)

Same as iota but with explicit conversion to type T.

pairs
auto pairs(Value[Key] aa)

Return Array of Key-Value Pairs of Associative Array aa. * * See_Also: https://github.com/D-Programming-Language/druntime/pull/574 * See_Also: http://forum.dlang.org/thread/dxotcrutrlmszlidufcr@forum.dlang.org?page=2#post-fhkgitmifgnompkqiscd:40forum.dlang.org

staticLengthRange
auto staticLengthRange(T[n] arr)

Overload has questionable memory safety. Would be quite cool if DIP-1000 could support this use case

zip
auto zip(R1 r1, R2 r2)

Faster than std.range.zip on DMD.

Structs

RingBuffer
struct RingBuffer(T)

Ring Buffer.

SlidingSplitter
struct SlidingSplitter(Range)

Sliding Splitter.

Templates

CommonElementType
template CommonElementType(Rs...)

Is the CommonType of the ElementTypes of the ranges Rs.

genTypeList
template genTypeList(T, size_t n)
isSortedRange_alt
template isSortedRange_alt(R)

True if R is a SortedRange

sortingPredicate
template sortingPredicate(Range, alias fallbackPred = "a < b")

Given a SortedRange R, sortingPredicate!R(a, b) will call in to the * predicate that was used to create the SortedRange. * * Params: * Range = the range to extract the predicate from * fallbackPred = the sorting predicate to fallback to if Range is not a SortedRange

Meta