ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/src/estl.h
(Generate patch)

Comparing libptytty/src/estl.h (file contents):
Revision 1.4 by root, Sat Jan 21 13:56:48 2012 UTC vs.
Revision 1.5 by sf-exg, Sat Jan 21 15:06:56 2012 UTC

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
7template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } 7template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; }
8template<typename T, typename U> static inline T max (T a, U b) { return a > (T)b ? a : (T)b; } 8template<typename T, typename U> static inline T max (T a, U b) { return a > (T)b ? a : (T)b; }
9 9
10template<typename T, typename U> static inline void swap (T& a, U& b) { T t = a; a = (T)b; b = (U)t; } 10template<typename T, typename U> static inline void swap (T& a, U& b) { T t = a; a = (T)b; b = (U)t; }
11 11
12template <typename I, typename T> 12template <typename I, typename T>
13I find (I first, I last, const T& value) 13I 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
254template<class T> 254template<class T>
255bool operator ==(const simplevec<T> &v1, const simplevec<T> &v2) 255bool operator ==(const simplevec<T> &v1, const simplevec<T> &v2)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines