aboutsummaryrefslogtreecommitdiff
path: root/cpp07/ex00/whatever.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp07/ex00/whatever.hpp')
-rw-r--r--cpp07/ex00/whatever.hpp36
1 files changed, 36 insertions, 0 deletions
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 <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