aboutsummaryrefslogtreecommitdiff
path: root/cpp08/ex00/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp08/ex00/main.cpp')
-rw-r--r--cpp08/ex00/main.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/cpp08/ex00/main.cpp b/cpp08/ex00/main.cpp
new file mode 100644
index 0000000..8824f99
--- /dev/null
+++ b/cpp08/ex00/main.cpp
@@ -0,0 +1,46 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/15 05:57:10 by charles #+# #+# */
+/* Updated: 2020/04/15 06:47:52 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include <iostream>
+#include <vector>
+#include <list>
+#include <deque>
+#include "easyfind.hpp"
+
+int main()
+{
+ int a[] = {10, 20, 30, 40, 50, 60};
+ std::vector<int> b(a, a + 6);
+ std::list<int> c(a, a + 6);
+ std::deque<int> d(a, a + 6);
+
+ std::cout << (easyfind(b, 10) != b.end()) << std::endl;
+ std::cout << (easyfind(c, 20) != c.end()) << std::endl;
+ std::cout << (easyfind(d, 30) != d.end()) << std::endl;
+ std::cout << (easyfind(b, 40) != b.end()) << std::endl;
+ std::cout << (easyfind(c, 50) != c.end()) << std::endl;
+ std::cout << (easyfind(d, 60) != d.end()) << std::endl;
+
+ std::cout << *easyfind(b, 10) << std::endl;
+ std::cout << *easyfind(c, 20) << std::endl;
+ std::cout << *easyfind(d, 30) << std::endl;
+ std::cout << *easyfind(b, 40) << std::endl;
+ std::cout << *easyfind(c, 50) << std::endl;
+ std::cout << *easyfind(d, 60) << std::endl;
+
+
+ std::cout << (easyfind(b, 70) != b.end()) << std::endl;
+ std::cout << (easyfind(c, 80) != c.end()) << std::endl;
+ std::cout << (easyfind(d, 90) != d.end()) << std::endl;
+
+ return 0;
+}