FlattenedRanges

Flattens a list Values of ranges and non ranges.

If a type is a range then its ElementType is used.

@safe
template FlattenedRanges (
Values...
) {}

Examples

import std.algorithm : filter;
import std.meta : AliasSeq;

alias R1 = typeof([1, 2, 3].filter!"true");
alias R2 = typeof([1.0, 2.0, 3.0]);

static assert(is(FlattenedRanges!(int, double) == AliasSeq!(int, double)));
static assert(is(FlattenedRanges!(int, R1, R2) == AliasSeq!(int, int, double)));

import std.traits : CommonType;

static assert(is(CommonType!(FlattenedRanges!(int, R1, R2, float)) == double));

Meta