添加swap
This commit is contained in:
13
TinySTL/Utility.h
Normal file
13
TinySTL/Utility.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef _UTILITY_H_
|
||||
#define _UTILITY_H_
|
||||
|
||||
namespace TinySTL{
|
||||
//************ [swap] ***************
|
||||
template<class T>
|
||||
void swap(T& a, T& b){
|
||||
T temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user