func swapme<T>(inout a:T,inout b:T,inout c:T){
(a,b,c) = (b,c,a);
}
var a:Int = 1;
var b:Int = 2;
var c:Int = 3;
println("\(a),\(b),\(c)");
swapme(&a,&b,&c);
\(c)");
原文链接:https://www.f2er.com/swift/326866.html
func swapme<T>(inout a:T,inout b:T,inout c:T){
(a,b,c) = (b,c,a);
}
var a:Int = 1;
var b:Int = 2;
var c:Int = 3;
println("\(a),\(b),\(c)");
swapme(&a,&b,&c);
\(c)");
原文链接:https://www.f2er.com/swift/326866.html