d07 ex00 ok

This commit is contained in:
hugogogo
2022-03-10 17:35:52 +01:00
parent 31c9d8af06
commit a8b1a6af1b
7 changed files with 127 additions and 36 deletions

View 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