#pragma once #include "tl/detail/prologue.h" #include "tl/algorithm/find.h" #include namespace tl { ////////////////////////////////////////////////////////////////////////// template bool contains(C& c, T&& value) noexcept { return tl::find(c, std::forward(value)) != tl::end(c); } template bool contains(const C& c, T&& value) noexcept { return tl::cfind(c, std::forward(value)) != tl::end(c); } template bool contains_if(C& c, UnaryPredicate&& p) noexcept { return tl::find_if(c, std::forward(p)) != tl::end(c); } template bool contains_if(const C& c, UnaryPredicate&& p) noexcept { return tl::cfind_if(c, std::forward(p)) != tl::end(c); } ////////////////////////////////////////////////////////////////////////// }