/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* easyfind.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/14 19:07:43 by adjoly #+# #+# */ /* Updated: 2025/04/14 19:33:52 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include #include #include template typename T::iterator easyfind(T val, int what) { typename T::iterator it = std::find(val.begin(), val.end(), what); if (it == val.end()) throw std::runtime_error("value not found"); return it; }