Daily bit(e) of C++ | std::ranges::contains, std::ranges::contains_subrange
Daily bit(e) of C++ ♻️122, Simpler linear presence checks using the C++23 std::ranges::contains and std::ranges::contains_subrange.
C++23 introduced two new algorithms in the ranges namespace.
std::ranges::contains
std::ranges::contains_subrange
These two algorithms do not introduce novel behaviour; instead, they remove the need to interpret the results of std::ranges::find and std::ranges::search.