aboutsummaryrefslogtreecommitdiff
path: root/cpp07/ex00/whatever.hpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-12-14 15:30:28 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-12-14 15:30:28 +0100
commit1de596dd9242b677d6b47b51db98ce98feb95465 (patch)
treeacbc79883c0af843b8b999a39f96cefd48e6e390 /cpp07/ex00/whatever.hpp
parentb13cd117a7957f9d86ec2986b47349979325a854 (diff)
downloadpiscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.tar.gz
piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.tar.bz2
piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.zip
Updated cpp07 files with new subject
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