mergeRange

Merge the elements of two ranges. If first is not a range then merge that with each element of the second range.

mergeRange
(
R1
R2
)
(
R1 r1
,
R2 r2
)

Examples

import std.range : front;

auto xs = ["a", "b"];
auto ys = ["c", "d"];
auto labels = ["e", "f"];
auto aes = Aes!(string[], "x", string[], "y", string[], "label")(xs, ys, labels);
auto nlAes = mergeRange(DefaultValues, aes );
assertEqual(nlAes.front.x, "a");
assertEqual(nlAes.front.label, "e");
assertEqual(nlAes.front.colour, "black");
import std.range : front;

auto xs = ["a", "b"];
auto ys = ["c", "d"];
auto labels = ["e", "f"];
auto aes = Aes!(string[], "x", string[], "y", string[], "label")(xs, ys, labels);

auto nlAes = mergeRange(aes, Aes!(NumericLabel!(string[]), "x",
    NumericLabel!(string[]), "y")(NumericLabel!(string[])(aes.x),
    NumericLabel!(string[])(aes.y)));

assertEqual(nlAes.front.x[0], 0);
assertEqual(nlAes.front.label, "e");

Meta