You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.6 KiB
44 lines
1.6 KiB
2 years ago
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* main.cpp :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/09/19 08:06:21 by narnaud #+# #+# */
|
||
|
/* Updated: 2022/09/19 08:06:26 by narnaud ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "easyfind.hpp"
|
||
|
#include <iostream>
|
||
|
#include <list>
|
||
|
#include <string>
|
||
|
#include <vector>
|
||
|
|
||
|
int main(void) {
|
||
|
std::vector<int> tab;
|
||
|
std::vector<int>::iterator tab_it;
|
||
|
std::list<int> lst;
|
||
|
std::list<int>::iterator lst_it;
|
||
|
std::string str = "abcdefghijklmnopqrstuvwxyz\n";
|
||
|
std::string::iterator str_it;
|
||
|
|
||
|
tab.push_back(5);
|
||
|
tab.push_back(50);
|
||
|
lst.push_back(5);
|
||
|
lst.push_back(50);
|
||
|
|
||
|
tab_it = easyfind(tab, 50);
|
||
|
lst_it = easyfind(lst, 50);
|
||
|
str_it = easyfind(str, 50);
|
||
|
|
||
|
std::cout << "Array search:" << std::endl;
|
||
|
is_easyfound(tab_it, tab.end());
|
||
|
std::cout << "List search:" << std::endl;
|
||
|
is_easyfound(lst_it, lst.end());
|
||
|
std::cout << "String search" << std::endl;
|
||
|
is_easyfound(str_it, str.end());
|
||
|
return (0);
|
||
|
}
|