diff options
Diffstat (limited to 'include')
-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 |