summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/ADT/STLExtras.h10
-rw-r--r--llvm/unittests/ADT/STLExtrasTest.cpp6
2 files changed, 8 insertions, 8 deletions
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index e0d06f9f94a..3eae7061a40 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -693,7 +693,7 @@ template <typename R> detail::enumerator_impl<R> enumerate(R &&Range) {
namespace detail {
template <typename F, typename Tuple, std::size_t... I>
-auto apply_impl(F &&f, Tuple &&t, index_sequence<I...>)
+auto apply_tuple_impl(F &&f, Tuple &&t, index_sequence<I...>)
-> decltype(std::forward<F>(f)(std::get<I>(std::forward<Tuple>(t))...)) {
return std::forward<F>(f)(std::get<I>(std::forward<Tuple>(t))...);
}
@@ -703,15 +703,15 @@ auto apply_impl(F &&f, Tuple &&t, index_sequence<I...>)
/// tuple variadically to f as if by calling f(a1, a2, ..., an) and
/// return the result.
template <typename F, typename Tuple>
-auto apply(F &&f, Tuple &&t) -> decltype(detail::apply_impl(
+auto apply_tuple(F &&f, Tuple &&t) -> decltype(detail::apply_tuple_impl(
std::forward<F>(f), std::forward<Tuple>(t),
build_index_impl<
- std::tuple_size<typename std::decay<Tuple>::type>::value>())) {
+ std::tuple_size<typename std::decay<Tuple>::type>::value>{})) {
using Indices = build_index_impl<
std::tuple_size<typename std::decay<Tuple>::type>::value>;
- return detail::apply_impl(std::forward<F>(f), std::forward<Tuple>(t),
- Indices());
+ return detail::apply_tuple_impl(std::forward<F>(f), std::forward<Tuple>(t),
+ Indices{});
}
} // End llvm namespace
diff --git a/llvm/unittests/ADT/STLExtrasTest.cpp b/llvm/unittests/ADT/STLExtrasTest.cpp
index 8675f6d5ce1..1b00ec3140a 100644
--- a/llvm/unittests/ADT/STLExtrasTest.cpp
+++ b/llvm/unittests/ADT/STLExtrasTest.cpp
@@ -195,7 +195,7 @@ TEST(STLExtrasTest, EnumerateLifetimeSemantics) {
TEST(STLExtrasTest, ApplyTuple) {
auto T = std::make_tuple(1, 3, 7);
- auto U = llvm::apply(
+ auto U = llvm::apply_tuple(
[](int A, int B, int C) { return std::make_tuple(A - B, B - C, C - A); },
T);
@@ -203,7 +203,7 @@ TEST(STLExtrasTest, ApplyTuple) {
EXPECT_EQ(-4, std::get<1>(U));
EXPECT_EQ(6, std::get<2>(U));
- auto V = llvm::apply(
+ auto V = llvm::apply_tuple(
[](int A, int B, int C) {
return std::make_tuple(std::make_pair(A, char('A' + A)),
std::make_pair(B, char('A' + B)),
@@ -231,7 +231,7 @@ public:
TEST(STLExtrasTest, ApplyTupleVariadic) {
auto Items = std::make_tuple(1, llvm::StringRef("Test"), 'X');
- auto Values = apply(apply_variadic(), Items);
+ auto Values = apply_tuple(apply_variadic(), Items);
EXPECT_EQ(2, std::get<0>(Values));
EXPECT_EQ("Tes", std::get<1>(Values));
OpenPOWER on IntegriCloud