Commit 13655b8a authored by Pádraig Brady's avatar Pádraig Brady Committed by Facebook GitHub Bot

folly: fix clash with std::reduce with libgcc >= 9.3.0

Summary:
This code is new in 9.3.0, introduced upstream with:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ed920373
Unless we qualify folly::reduce() we get the clash
in P127472223 when running the test plan.

Reviewed By: meyering

Differential Revision: D20461173

fbshipit-source-id: 41b21e9215571da2cbd2ef7f817e2d9999083033
parent d9407ff2
...@@ -2551,12 +2551,12 @@ Future<T> reduce(It first, It last, T&& initial, F&& func); ...@@ -2551,12 +2551,12 @@ Future<T> reduce(It first, It last, T&& initial, F&& func);
/// Sugar for the most common case /// Sugar for the most common case
template <class Collection, class T, class F> template <class Collection, class T, class F>
auto reduce(Collection&& c, T&& initial, F&& func) -> decltype(reduce( auto reduce(Collection&& c, T&& initial, F&& func) -> decltype(folly::reduce(
c.begin(), c.begin(),
c.end(), c.end(),
std::forward<T>(initial), std::forward<T>(initial),
std::forward<F>(func))) { std::forward<F>(func))) {
return reduce( return folly::reduce(
c.begin(), c.end(), std::forward<T>(initial), std::forward<F>(func)); c.begin(), c.end(), std::forward<T>(initial), std::forward<F>(func));
} }
...@@ -2569,12 +2569,12 @@ Future<T> unorderedReduce(It first, It last, T initial, F func); ...@@ -2569,12 +2569,12 @@ Future<T> unorderedReduce(It first, It last, T initial, F func);
/// Sugar for the most common case /// Sugar for the most common case
template <class Collection, class T, class F> template <class Collection, class T, class F>
auto unorderedReduce(Collection&& c, T&& initial, F&& func) auto unorderedReduce(Collection&& c, T&& initial, F&& func)
-> decltype(unorderedReduce( -> decltype(folly::unorderedReduce(
c.begin(), c.begin(),
c.end(), c.end(),
std::forward<T>(initial), std::forward<T>(initial),
std::forward<F>(func))) { std::forward<F>(func))) {
return unorderedReduce( return folly::unorderedReduce(
c.begin(), c.end(), std::forward<T>(initial), std::forward<F>(func)); c.begin(), c.end(), std::forward<T>(initial), std::forward<F>(func));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment