Statically allocate futex array
[folly.git] / folly / gen / ParallelMap-inl.h
index 7975b21d9b87d904e437ae66841567a2ff1741e4..906ce88a75e004ae3bd6a1c1d08f9104b129ac10 100644 (file)
@@ -42,7 +42,7 @@ namespace detail {
  *
  *   auto squares = seq(1, 10) | pmap(fibonacci, 4) | sum;
  */
-template<class Predicate>
+template <class Predicate>
 class PMap : public Operator<PMap<Predicate>> {
   Predicate pred_;
   size_t nThreads_;
@@ -53,12 +53,12 @@ class PMap : public Operator<PMap<Predicate>> {
     : pred_(std::move(pred)),
       nThreads_(nThreads) { }
 
-  template<class Value,
-           class Source,
-           class Input = typename std::decay<Value>::type,
-           class Output = typename std::decay<
-             typename std::result_of<Predicate(Value)>::type
-             >::type>
+  template <
+      class Value,
+      class Source,
+      class Input = typename std::decay<Value>::type,
+      class Output = typename std::decay<
+          typename std::result_of<Predicate(Value)>::type>::type>
   class Generator :
     public GenImpl<Output, Generator<Value, Source, Input, Output>> {
     Source source_;
@@ -146,14 +146,14 @@ class PMap : public Operator<PMap<Predicate>> {
       }
     };
 
-  public:
+   public:
     Generator(Source source, const Predicate& pred, size_t nThreads)
       : source_(std::move(source)),
         pred_(pred),
         nThreads_(nThreads ? nThreads : sysconf(_SC_NPROCESSORS_ONLN)) {
     }
 
-    template<class Body>
+    template <class Body>
     void foreach(Body&& body) const {
       ExecutionPipeline pipeline(pred_, nThreads_);
 
@@ -190,7 +190,7 @@ class PMap : public Operator<PMap<Predicate>> {
       }
     }
 
-    template<class Handler>
+    template <class Handler>
     bool apply(Handler&& handler) const {
       ExecutionPipeline pipeline(pred_, nThreads_);
 
@@ -238,16 +238,12 @@ class PMap : public Operator<PMap<Predicate>> {
     static constexpr bool infinite = Source::infinite;
   };
 
-  template<class Source,
-           class Value,
-           class Gen = Generator<Value, Source>>
+  template <class Source, class Value, class Gen = Generator<Value, Source>>
   Gen compose(GenImpl<Value, Source>&& source) const {
     return Gen(std::move(source.self()), pred_, nThreads_);
   }
 
-  template<class Source,
-           class Value,
-           class Gen = Generator<Value, Source>>
+  template <class Source, class Value, class Gen = Generator<Value, Source>>
   Gen compose(const GenImpl<Value, Source>& source) const {
     return Gen(source.self(), pred_, nThreads_);
   }