From efb47cdc3092e72148a1b592383f9ffed12b2b16 Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 11 Apr 2003 15:13:38 +0000 Subject: added swap --- include/generic.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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 +inline void SWAP(T & a, T & b) { + T t = a; + a = b; + b = t; +} +#endif + #else // cplusplus #ifndef MAX -- cgit v1.2.3