This is a fun one.  I don't suppose someone can suggest a workaround?  If an 
argument is added to the call to foo() in main (so it really does return a 
Tuple) the code compiles without incident.  I ran into this while making sure 
all the code samples in TDPL ch.13 work.


    import std.typecons;

    template fooRet(T...)
    {
        static if( T.length == 1 )
            alias T fooRet;
        else
            alias Tuple!(T) fooRet;
    }

    fooRet!(T) foo(T...)(T vals)
    {
        Tuple!(T) ret;
        static if( T.length == 1 )
            return ret.field[0];
        else
            return ret;
    }

    void main()
    {
        auto x = foo(1)();
    }
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to