On Tuesday, 8 July 2014 at 19:40:59 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
        template TypesOf(T...)
        {
                static if (T.length == 1)
                        alias TypesOf = typeof(T[0]);
                else
                        alias TypesOf = TypeTuple!(typeof(T[0]), 
TypesOf!(T[1..$]));
        }
        
        @property void tie(T...)(Tuple!(TypesOf!T) t)
[...]
It does involve some slightly more arcane template magic, though. ;-) Basically, the TypesOf template transforms a list of alias arguments into a list of the types of said arguments, so that we can match a list
of variables to the Tuple that is to be assigned to them.

typeof(T) would work, too.

Reply via email to