From 1de596dd9242b677d6b47b51db98ce98feb95465 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 14 Dec 2020 15:30:28 +0100 Subject: Updated cpp07 files with new subject --- cpp07/ex00/whatever.hpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cpp07/ex00/whatever.hpp (limited to 'cpp07/ex00/whatever.hpp') diff --git a/cpp07/ex00/whatever.hpp b/cpp07/ex00/whatever.hpp new file mode 100644 index 0000000..8768a44 --- /dev/null +++ b/cpp07/ex00/whatever.hpp @@ -0,0 +1,36 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* whatever.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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 +void swap(T& a, T& b) +{ + T tmp(a); + a = b; + b = tmp; +} + +template +T& min(T& a, T& b) +{ + return a < b ? a : b; +} + +template +T& max(T& a, T& b) +{ + return a > b ? a : b; +} + +#endif -- cgit