diff options
author | pixel <pixel> | 2003-04-11 15:13:38 +0000 |
---|---|---|
committer | pixel <pixel> | 2003-04-11 15:13:38 +0000 |
commit | efb47cdc3092e72148a1b592383f9ffed12b2b16 (patch) | |
tree | fe32d807ef710a6a7a192951c064e5239aa4ca68 | |
parent | 4695cf1e7aeca0cd80d02cce6d30ac0f4aeb963c (diff) |
added swap
-rw-r--r-- | include/generic.h | 9 |
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 |