[llvm] 3c6a518 - [NFC] Use appropriate names for `for_each` and `transform` template parameters
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 16 09:35:44 PDT 2020
Author: Rahul Joshi
Date: 2020-07-16T09:35:16-07:00
New Revision: 3c6a518a2fd2f85bb3e0e53a02c56234affccf94
URL: https://github.com/llvm/llvm-project/commit/3c6a518a2fd2f85bb3e0e53a02c56234affccf94
DIFF: https://github.com/llvm/llvm-project/commit/3c6a518a2fd2f85bb3e0e53a02c56234affccf94.diff
LOG: [NFC] Use appropriate names for `for_each` and `transform` template parameters
Differential Revision: https://reviews.llvm.org/D83848
Added:
Modified:
llvm/include/llvm/ADT/STLExtras.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 50b688b36648..eed676bb74e1 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -1480,9 +1480,9 @@ auto size(R &&Range,
/// Provide wrappers to std::for_each which take ranges instead of having to
/// pass begin/end explicitly.
-template <typename R, typename UnaryPredicate>
-UnaryPredicate for_each(R &&Range, UnaryPredicate P) {
- return std::for_each(adl_begin(Range), adl_end(Range), P);
+template <typename R, typename UnaryFunction>
+UnaryFunction for_each(R &&Range, UnaryFunction F) {
+ return std::for_each(adl_begin(Range), adl_end(Range), F);
}
/// Provide wrappers to std::all_of which take ranges instead of having to pass
@@ -1577,9 +1577,9 @@ auto count_if(R &&Range, UnaryPredicate P) {
/// Wrapper function around std::transform to apply a function to a range and
/// store the result elsewhere.
-template <typename R, typename OutputIt, typename UnaryPredicate>
-OutputIt transform(R &&Range, OutputIt d_first, UnaryPredicate P) {
- return std::transform(adl_begin(Range), adl_end(Range), d_first, P);
+template <typename R, typename OutputIt, typename UnaryFunction>
+OutputIt transform(R &&Range, OutputIt d_first, UnaryFunction F) {
+ return std::transform(adl_begin(Range), adl_end(Range), d_first, F);
}
/// Provide wrappers to std::partition which take ranges instead of having to
More information about the llvm-commits
mailing list