ex00 done
This commit is contained in:
45
ex00/whatever.hpp
Normal file
45
ex00/whatever.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* whatever.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/21 15:44:59 by aortigos #+# #+# */
|
||||
/* Updated: 2026/03/21 15:48:28 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef SWAP_HPP
|
||||
|
||||
# define SWAP_HPP
|
||||
|
||||
# include <iostream>
|
||||
|
||||
template <typename T>
|
||||
void swap(T &a, T &b)
|
||||
{
|
||||
T tmp;
|
||||
|
||||
tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T min(T const &a, T const &b)
|
||||
{
|
||||
if (a < b)
|
||||
return (a);
|
||||
return (b);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T max(T const &a, T const &b)
|
||||
{
|
||||
if (a > b)
|
||||
return (a);
|
||||
return (b);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user