Commit a8990a74 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Refactor non-variadic collect variants

Summary:
[Folly] Refactor non-variadic `collect` variants.

No change in behavior - just moving code around.

Reviewed By: marshallcline

Differential Revision: D8440630

fbshipit-source-id: a6349c73c2109237f1be174c2260e9c9eb2d1c0e
parent 698d1e78
This diff is collapsed.
...@@ -72,7 +72,6 @@ namespace futures { ...@@ -72,7 +72,6 @@ namespace futures {
namespace detail { namespace detail {
template <class> class Core; template <class> class Core;
template <class> struct CollectContext;
template <typename...> template <typename...>
struct ArgType; struct ArgType;
......
...@@ -307,8 +307,8 @@ Future<std::tuple<Try<typename remove_cvref_t<Fs>::value_type>...>> collectAll( ...@@ -307,8 +307,8 @@ Future<std::tuple<Try<typename remove_cvref_t<Fs>::value_type>...>> collectAll(
/// type of the returned Future is std::vector<T> instead of /// type of the returned Future is std::vector<T> instead of
/// std::vector<Try<T>> /// std::vector<Try<T>>
template <class InputIterator> template <class InputIterator>
Future<typename futures::detail::CollectContext<typename std::iterator_traits< Future<std::vector<
InputIterator>::value_type::value_type>::result_type> typename std::iterator_traits<InputIterator>::value_type::value_type>>
collect(InputIterator first, InputIterator last); collect(InputIterator first, InputIterator last);
/// Sugar for the most common case /// Sugar for the most common case
...@@ -435,12 +435,7 @@ auto reduce(Collection&& c, T&& initial, F&& func) ...@@ -435,12 +435,7 @@ auto reduce(Collection&& c, T&& initial, F&& func)
/** like reduce, but calls func on finished futures as they complete /** like reduce, but calls func on finished futures as they complete
does NOT keep the order of the input does NOT keep the order of the input
*/ */
template < template <class It, class T, class F>
class It,
class T,
class F,
class ItT = typename std::iterator_traits<It>::value_type::value_type,
class Arg = MaybeTryArg<F, T, ItT>>
Future<T> unorderedReduce(It first, It last, T initial, F func); Future<T> unorderedReduce(It first, It last, T initial, F func);
/// Sugar for the most common case /// Sugar for the most common case
......
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