Skip to content

[ADT] Minor code cleanup in STLExtras.h #104808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion llvm/include/llvm/ADT/STLExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ OutputIt replace_copy(R &&Range, OutputIt Out, const T &OldValue,
/// begin/end explicitly.
template <typename R, typename T>
void replace(R &&Range, const T &OldValue, const T &NewValue) {
return std::replace(adl_begin(Range), adl_end(Range), OldValue, NewValue);
std::replace(adl_begin(Range), adl_end(Range), OldValue, NewValue);
}

/// Provide wrappers to std::move which take ranges instead of having to
Expand Down Expand Up @@ -1982,6 +1982,8 @@ auto upper_bound(R &&Range, T &&Value, Compare C) {
std::forward<T>(Value), C);
}

/// Provide wrappers to std::min_element which take ranges instead of having to
/// pass begin/end explicitly.
template <typename R> auto min_element(R &&Range) {
return std::min_element(adl_begin(Range), adl_end(Range));
}
Expand All @@ -1990,6 +1992,8 @@ template <typename R, typename Compare> auto min_element(R &&Range, Compare C) {
return std::min_element(adl_begin(Range), adl_end(Range), C);
}

/// Provide wrappers to std::max_element which take ranges instead of having to
/// pass begin/end explicitly.
template <typename R> auto max_element(R &&Range) {
return std::max_element(adl_begin(Range), adl_end(Range));
}
Expand Down
Loading