aboutsummaryrefslogtreecommitdiff
path: root/cpp07/ex00/whatever.hpp
blob: 8768a44645406f9c3e5f92c9ca36008749d164c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   whatever.hpp                                       :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: charles <charles.cabergs@gmail.com>        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/04/14 19:46:56 by charles           #+#    #+#             */
/*   Updated: 2020/12/14 15:05:32 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef WHATEVER_HPP
# define WHATEVER_HPP

template<typename T>
void swap(T& a, T& b)
{
    T tmp(a);
    a = b;
    b = tmp;
}

template<typename T>
T& min(T& a, T& b)
{
    return a < b ? a : b;
}

template<typename T>
T& max(T& a, T& b)
{
    return a > b ? a : b;
}

#endif