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);
println("\(a),\(b),\(c)");
原文地址:http://blog.csdn.net/crazyeveryday/article/details/46580815