pass

Starts a pipeline to be used as an output range.

  1. auto pass [@property getter]
  2. auto pass [@property getter]
    @property
    pass
    (
    E
    alias fun
    )
    ()
  3. void testOutputRange()

Parameters

E

Type of elements accepted by the output range.

Return Value

Type: auto

A flod.pipeline.Schema to which next stages can be appended.

Examples

import flod : array;
import std.array : appender;
import std.format : formattedWrite;
import std.range : put;

// Create an pipeline object that can be used as output range
auto app = appender!string;
auto p = pass!char.copy(app);
put(p, "Hello, world!\n");
p.formattedWrite("The answer is: %d\n", 42);
assert(app.data == "Hello, world!\nThe answer is: 42\n");

// Write to a pipeline from a lambda
auto s = pass!(char, (r) {
		put(r, "Hello, lambda world!\n");
		r.formattedWrite("The answer is still %d\n", 42);
	})
	.array();
assert(s == "Hello, lambda world!\nThe answer is still 42\n");

Meta