d07 ex00 ok
This commit is contained in:
28
d07/ex00/headers/Templates.hpp
Normal file
28
d07/ex00/headers/Templates.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef TEMPLATES_HPP
|
||||
# define TEMPLATES_HPP
|
||||
|
||||
template< typename T >
|
||||
void swap(T &a, T &b) {
|
||||
|
||||
T tmp;
|
||||
|
||||
tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
T const & min(T const &a, T const &b) {
|
||||
if (a < b)
|
||||
return a;
|
||||
return b;
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
T const & max(T const &a, T const &b) {
|
||||
if (a > b)
|
||||
return a;
|
||||
return b;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user