summaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.phobos/std_typetuple.d
blob: e5ccd7637a216059c3f1c6aea61ade121be868fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@safe unittest
{
    import std.typetuple;

    import std.typetuple;
    alias TL = TypeTuple!(int, double);

    int foo(TL td)  // same as int foo(int, double);
    {
        return td[0] + cast(int) td[1];
    }
    assert(foo(1, 2.5) == 3);
}

@safe unittest
{
    import std.typetuple;

    alias TL = TypeTuple!(int, double);

    alias Types = TypeTuple!(TL, char);
    static assert(is(Types == TypeTuple!(int, double, char)));
}