I assume you are using D2 because I do not know about D1.
There are tuple and tuple in std.typecons that allow you to use these "irrevocable" or "compilation time tuples" to create runtime values.
import std.typecons, std.stdio; Tuple!(int, string, int[]) f() { return tuple(5, "xyz", [3, 4, 5]); } void main() { auto x = f(); writefln("%s is %s", x[1], x[0]);
Use tuple(v1, v2) as the value and Tuple!(T1, T2) as you type it.
If you really need a list of things that you donโt know the type during the import compilation of std.variant , then Variant[] as a list of these things.
Mafi
source share