Project made from zero
This commit is contained in:
@@ -5,40 +5,39 @@
|
||||
/* +:+ +:+ +:+ */
|
||||
/* 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 */
|
||||
/* Created: 2026/03/23 14:10:38 by aortigos #+# #+# */
|
||||
/* Updated: 2026/03/23 14:13:22 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef SWAP_HPP
|
||||
#ifndef WHATEVER_HPP
|
||||
|
||||
# define SWAP_HPP
|
||||
# define WHATEVER_HPP
|
||||
|
||||
# include <iostream>
|
||||
|
||||
template <typename T>
|
||||
void swap(T &a, T &b)
|
||||
void swap(T &x, T &y)
|
||||
{
|
||||
T tmp = a;
|
||||
T tmp = x;
|
||||
|
||||
a = b;
|
||||
b = tmp;
|
||||
x = y;
|
||||
y = tmp;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T min(T const &a, T const &b)
|
||||
T min(T &x, T &y)
|
||||
{
|
||||
if (a < b)
|
||||
return (a);
|
||||
return (b);
|
||||
if (x < y)
|
||||
return (x);
|
||||
return (y);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T max(T const &a, T const &b)
|
||||
T max(T &x, T &y)
|
||||
{
|
||||
if (a > b)
|
||||
return (a);
|
||||
return (b);
|
||||
if (x > y)
|
||||
return (x);
|
||||
return (y);
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user