ae.utils.range

ae.utils.range

Members

Aliases

NullTerminated
deprecated alias NullTerminated = NullTerminatedPtrRange
Undocumented in source.
nullTerminated
deprecated alias nullTerminated = nullTerminatedPtrRange
Undocumented in source.
pmap
deprecated alias pmap = ae.utils.functor.algorithm.map
Undocumented in source.

Functions

average
auto average(R range)

Calculate the mean value of the range's elements (sum divided by length). The range must obviously be non-empty.

emptyRange
EmptyRange!E emptyRange()
Undocumented in source. Be warned that the author may not have intended to support it.
fastArrayRange
auto fastArrayRange(T[] arr)
Undocumented in source. Be warned that the author may not have intended to support it.
fastCartesianProduct
auto fastCartesianProduct(R ranges)

A faster, random-access version of cartesianProduct.

infiniteIota
InfiniteIota!T infiniteIota()
Undocumented in source. Be warned that the author may not have intended to support it.
lazyInitRange
auto lazyInitRange(R delegate() constructor)

Defer range construction until first empty/front call.

nullTerminatedPtrRange
auto nullTerminatedPtrRange(E* ptr)
Undocumented in source. Be warned that the author may not have intended to support it.
onlyLazy
auto onlyLazy(E value)

Like only, but evaluates the argument lazily, i.e. when the range's "front" is evaluated. DO NOT USE before this bug is fixed: https://issues.dlang.org/show_bug.cgi?id=11044

ptrSlice
T[] ptrSlice(T* a, T* b)

Returns a slice for the memory from a to b.

Structs

EmptyRange
struct EmptyRange(E)

Empty range of type E.

FastArrayRange
struct FastArrayRange(T, bool CHECKED = isDebug)

An equivalent of an array range, but which maintains a start and end pointer instead of a start pointer and length. This allows .popFront to be faster. Optionally, omits bounds checking for even more speed.

InfiniteIota
struct InfiniteIota(T)

An infinite variant of iota.

NullTerminatedPtrRange
struct NullTerminatedPtrRange(E)

Presents a null-terminated pointer (C-like string) as a range.

Templates

pairwise
template pairwise(alias pred)

Apply a predicate over each consecutive pair.

Meta

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Authors

Vladimir Panteleev <ae@cy.md>