import std.stdio;
import std.typecons;
void method1(int a, string b, float c, char d) {
writeln("method 1 ",a,"/t",b,"/t",c,"/t",d);
}
void method2(int a, float b, char c) {
writeln("method 2 ",a,"/t",b,"/t",c);
}
void main() {
auto myTuple = tuple(5, "my string", 3.3, 'r');
writeln("method1 call 1");
method1(myTuple[]);
writeln("method1 call 2");
method1(myTuple.expand);
writeln("method2 call 1");
method2(myTuple[0], myTuple[$-2..$]);
}
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266013.html