| 123456789101112131415161718192021222324252627282930313233343536373839 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* Swap.hpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2026/01/09 14:08:45 by bchanot #+# #+# */
- /* Updated: 2026/01/09 15:26:46 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #ifndef SWAP_HPP
- # define SWAP_HPP
- # include <iostream>
- # include <string>
- template < typename T >
- void swap(T &x, T &y) {
- T temp;
- temp = x;
- x = y;
- y = temp;
- }
- template < typename T >
- T min(T const & x, T const & y) {
- return (x < y ? x : y);
- }
- template < typename T >
- T max(T const & x, T const & y) {
- return (x > y ? x : y);
- }
- #endif
|