Skip to content

Commit

Permalink
Mention c_any_of in the function comment of absl::c_linear_search.
Browse files Browse the repository at this point in the history
This should help readers who find `c_linear_search` but need the more general form and don't guess that it exists under this rather different name.

PiperOrigin-RevId: 698124511
Change-Id: I1dfd33707d3dfb2a98527f706b97c3327acc6e76
  • Loading branch information
Abseil Team authored and copybara-github committed Nov 19, 2024
1 parent 4a437e8 commit b67caff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions absl/algorithm/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ struct IsUnorderedContainer<std::unordered_set<Key, Hash, KeyEqual, Allocator>>
//
// Container-based version of absl::linear_search() for performing a linear
// search within a container.
//
// For a generalization that uses a predicate, see absl::c_any_of().
template <typename C, typename EqualityComparable>
ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool c_linear_search(
const C& c, EqualityComparable&& value) {
Expand Down

0 comments on commit b67caff

Please sign in to comment.