summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpixel <pixel>2003-04-11 15:13:38 +0000
committerpixel <pixel>2003-04-11 15:13:38 +0000
commitefb47cdc3092e72148a1b592383f9ffed12b2b16 (patch)
treefe32d807ef710a6a7a192951c064e5239aa4ca68
parent4695cf1e7aeca0cd80d02cce6d30ac0f4aeb963c (diff)
added swap
-rw-r--r--include/generic.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/generic.h b/include/generic.h
index 94b162c..1ec1f29 100644
--- a/include/generic.h
+++ b/include/generic.h
@@ -96,6 +96,15 @@ inline T MIN(T a, T b) {
}
#endif
+#ifndef SWAP
+template<class T>
+inline void SWAP(T & a, T & b) {
+ T t = a;
+ a = b;
+ b = t;
+}
+#endif
+
#else // cplusplus
#ifndef MAX