Files
42_INT_09_piscine_cpp/d07/ex00/Templates.hpp
2022-03-10 17:52:05 +01:00

29 lines
343 B
C++

#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