File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,12 @@ template <template <typename> class TargetT, typename SourceT>
5454#ifdef __cpp_lib_ranges_contains
5555constexpr auto rangeContains = std::ranges::contains;
5656#else
57- [[nodiscard]] constexpr auto rangeContains (const auto & c, const auto & v, auto proj)
57+ template <typename RangeT, typename ValT, typename ProjT = std::identity>
58+ requires std::indirect_binary_predicate<
59+ std::ranges::equal_to, std::projected<std::ranges::iterator_t <RangeT>, ProjT>, const ValT*>
60+ [[nodiscard]] constexpr auto rangeContains (const RangeT& r, const ValT& v, ProjT proj = {})
5861{
59- return std::ranges::find (c , v, std::move (proj)) != std::ranges::end (c );
62+ return std::ranges::find (r , v, std::move (proj)) != std::ranges::end (r );
6063}
6164#endif
6265
You can’t perform that action at this time.
0 commit comments