… | |
… | |
2 | #define ESTL_H_ |
2 | #define ESTL_H_ |
3 | |
3 | |
4 | #include <stdlib.h> |
4 | #include <stdlib.h> |
5 | #include <string.h> |
5 | #include <string.h> |
6 | |
6 | |
7 | template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } |
7 | template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } |
8 | template<typename T, typename U> static inline T max (T a, U b) { return a > (T)b ? a : (T)b; } |
8 | template<typename T, typename U> static inline T max (T a, U b) { return a > (T)b ? a : (T)b; } |
9 | |
9 | |
10 | template<typename T, typename U> static inline void swap (T& a, U& b) { T t = a; a = (T)b; b = (U)t; } |
10 | template<typename T, typename U> static inline void swap (T& a, U& b) { T t = a; a = (T)b; b = (U)t; } |
11 | |
11 | |
12 | template <typename I, typename T> |
12 | template <typename I, typename T> |
13 | I find (I first, I last, const T& value) |
13 | I find (I first, I last, const T& value) |
… | |
… | |
243 | } |
243 | } |
244 | } |
244 | } |
245 | |
245 | |
246 | void swap (simplevec<T> &t) |
246 | void swap (simplevec<T> &t) |
247 | { |
247 | { |
248 | ::swap(_last, t._last); |
248 | ::swap (_last, t._last); |
249 | ::swap(_size, t._size); |
249 | ::swap (_size, t._size); |
250 | ::swap(_buf, t._buf); |
250 | ::swap (_buf, t._buf); |
251 | } |
251 | } |
252 | }; |
252 | }; |
253 | |
253 | |
254 | template<class T> |
254 | template<class T> |
255 | bool operator ==(const simplevec<T> &v1, const simplevec<T> &v2) |
255 | bool operator ==(const simplevec<T> &v1, const simplevec<T> &v2) |