import std.range : front; import ggplotd.aes : Aes, DefaultValues; 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"); auto nlAes2 = aes.mergeRange(DefaultValues); assertEqual(nlAes2.front.x, "a"); assertEqual(nlAes2.front.label, ""); assertEqual(nlAes2.front.colour, "black");
Merge the elements of two ranges. If first is not a range then merge that with each element of the second range and vice versa.