iz.sugar

Several trivial functions and structures

Members

Enums

IdMode
enum IdMode

Deep iteration mode

Functions

applyWrap
string applyWrap(R returns)

Scans the method wrapped by the caller.

compare
bool compare(L lhs, R rhs)

Compares two integral values with additional static checkings.

deepIterate
bool deepIterate(Range range, A a)

Iterates a tree-like structure that exposes an input range interface and calls each element with a function.

dropBackWhile
auto dropBackWhile(Range range)

Convenience function that calls popBackWhile() on the input argument and returns the consumed range to allow function pipelining. In addition this wrapper accepts rvalues.

dropWhile
auto dropWhile(Range range)

Convenience function that calls popWhile() on the input argument and returns the consumed range to allow function pipelining. In addition this wrapper accepts rvalues.

flipFlop
auto flipFlop(R1 flip, R2 flop)

Returns a lazy input range that alterntively returns the state of one of two sub-ranges.

getDelegate
auto getDelegate(void* context, FT code)

Sets the context and the function of a new delegate.

mutatedCount
size_t mutatedCount(Range range)

Indicates how many elements of a range are different from the default element value.

pickAndCall
bool pickAndCall(T t, Fun fun, A a)

Calls a function according to a probability

popBackWhile
void popBackWhile(Range range)

Pops back an input range while a predicate is true. Consumes the input argument.

popWhile
void popWhile(Range range)

Pops an input range while a predicate is true. Consumes the input argument.

rValue
auto rValue(T t)

Allows to pass always a parameter as value even if it would be accepted as reference.

recursion
auto recursion(A a)

Allows to call recursively the function being executed.

setDelegate
void setDelegate(T t, void* context, FT code)

Sets the context and the function of a delegate.

takeBackWhile
auto takeBackWhile(Range range)

Returns a lazy input range that takes from the input tail while a predicate is verified and the input is not empty.

takeWhile
auto takeWhile(Range range)

Returns a lazy input range that takes from the input while a predicate is verified and the input is not empty.

throwStaticEx
void throwStaticEx()

Throws a static exception, suitable for @nogc functions.

Structs

ArrayRange
struct ArrayRange(T, bool assumeDecoded = false, bool infinite = false)

Alternative to std.range primitives for arrays.

Wrap
struct Wrap

Used the annotate the member functions that wrap other member functions. Each instance must specify aither the type, the instance and the name of the function that's wrapped or the name of a context-free function. Each string must be colon-separated.

Templates

bitCast
template bitCast(T, S)

Safely cast a value of a type to another, if both have the same size.

Unions

Delegate
union Delegate(FT)

The delegate union is a conveniant way to setup non gc delegates that are compatible with D delegates.

Meta