X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fgen%2FParallelMap-inl.h;h=22063113023e27744c67a1fe0f7934fe936bd794;hb=adb8559d5aae490f6a5620d5148f61322a267242;hp=7975b21d9b87d904e437ae66841567a2ff1741e4;hpb=1b0c0d91b2ab04619ff22e30d9758e286acf07fc;p=folly.git diff --git a/folly/gen/ParallelMap-inl.h b/folly/gen/ParallelMap-inl.h index 7975b21d..22063113 100644 --- a/folly/gen/ParallelMap-inl.h +++ b/folly/gen/ParallelMap-inl.h @@ -42,7 +42,7 @@ namespace detail { * * auto squares = seq(1, 10) | pmap(fibonacci, 4) | sum; */ -template +template class PMap : public Operator> { Predicate pred_; size_t nThreads_; @@ -53,12 +53,12 @@ class PMap : public Operator> { : pred_(std::move(pred)), nThreads_(nThreads) { } - template::type, - class Output = typename std::decay< - typename std::result_of::type - >::type> + template < + class Value, + class Source, + class Input = typename std::decay::type, + class Output = typename std::decay< + typename std::result_of::type>::type> class Generator : public GenImpl> { Source source_; @@ -153,7 +153,7 @@ class PMap : public Operator> { nThreads_(nThreads ? nThreads : sysconf(_SC_NPROCESSORS_ONLN)) { } - template + template void foreach(Body&& body) const { ExecutionPipeline pipeline(pred_, nThreads_); @@ -190,7 +190,7 @@ class PMap : public Operator> { } } - template + template bool apply(Handler&& handler) const { ExecutionPipeline pipeline(pred_, nThreads_); @@ -238,16 +238,12 @@ class PMap : public Operator> { static constexpr bool infinite = Source::infinite; }; - template> + template > Gen compose(GenImpl&& source) const { return Gen(std::move(source.self()), pred_, nThreads_); } - template> + template > Gen compose(const GenImpl& source) const { return Gen(source.self(), pred_, nThreads_); }