44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* 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 = 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 |