Mercurial > projects > qtd
changeset 155:875d313c2778
fix qSwap
author | mandel |
---|---|
date | Tue, 16 Jun 2009 21:18:54 +0000 |
parents | 00d84545551e |
children | 37cf6fd1ee85 |
files | qt/QGlobal.d |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/qt/QGlobal.d Tue Jun 16 17:54:33 2009 +0000 +++ b/qt/QGlobal.d Tue Jun 16 21:18:54 2009 +0000 @@ -398,11 +398,12 @@ value1.data_ptr() = value2.data_ptr(); value2.data_ptr() = t; } + void qSwap(T)(ref T value1, ref T value2) { - const T.DataPtr t = value1.data_ptr(); - value1.data_ptr() = value2.data_ptr(); - value2.data_ptr() = t; + T t = value1; + value1 = value2; + value2 = t; } /*