Michel Fortin , dans le message (digitalmars.D:164824), a écrit : > So with your system, how do you write the swap function?
I've thought about that.
The scope(label) is the key.
void T swap(T)(scope T a, scope(a) T b)
{
scope(a) tmp = a;
a = b;
b = tmp;
}
scope(inout) would also do the trick, since it is implicitely shared
between parameters and return values.
--
Christophe
