#pragma once #include #include namespace DCR { namespace fp { /** * @brief find element in container by maybe * @tparam Container * @tparam T * @param container * @param element * @return maybe */ template auto find(const Container& container, const T& element) -> maybe { // equals end, means there is NO element in container auto iter = container.find(element); if (iter == container.end()) { return {}; } return iter; } } // namespace fp } // namespace DCR