Formatting for template parameters
authorYedidya Feldblum <yfeldblum@fb.com>
Mon, 31 Jul 2017 02:40:25 +0000 (19:40 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 31 Jul 2017 02:50:25 +0000 (19:50 -0700)
Summary: [Folly] Formatting for template parameters.

Reviewed By: Orvid

Differential Revision: D5525123

fbshipit-source-id: 4feb772300cfdd6ae3168fe9f59f5a951fb85d0e

23 files changed:
folly/AtomicHashArray-inl.h
folly/AtomicHashArray.h
folly/AtomicHashMap-inl.h
folly/AtomicHashMap.h
folly/AtomicUnorderedMap.h
folly/FBString.h
folly/MPMCQueue.h
folly/Range.h
folly/SharedMutex.h
folly/Singleton.h
folly/String.h
folly/detail/MemoryIdler.h
folly/experimental/BitVectorCoding.h
folly/experimental/EliasFanoCoding.h
folly/experimental/StringKeyedMap.h
folly/experimental/StringKeyedSet.h
folly/experimental/TupleOps.h
folly/experimental/test/TupleOpsTest.cpp
folly/futures/detail/Core.h
folly/futures/helpers.h
folly/test/AtomicHashArrayTest.cpp
folly/test/AtomicUnorderedMapTest.cpp
folly/test/MPMCQueueTest.cpp

index ce857a92d31bbb11c36fa1cf555330248e2f9b73..5b81837953e6ecebca5feddcb187211eb3ec6b9b 100644 (file)
 namespace folly {
 
 // AtomicHashArray private constructor --
 namespace folly {
 
 // AtomicHashArray private constructor --
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                 Allocator, ProbeFcn, KeyConvertFcn>::
 AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
 AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                 Allocator, ProbeFcn, KeyConvertFcn>::
 AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
@@ -46,8 +52,14 @@ AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
  *   of key and returns true, or if key does not exist returns false and
  *   ret.index is set to capacity_.
  */
  *   of key and returns true, or if key does not exist returns false and
  *   ret.index is set to capacity_.
  */
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                          Allocator, ProbeFcn, KeyConvertFcn>::SimpleRetT
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                          Allocator, ProbeFcn, KeyConvertFcn>::SimpleRetT
@@ -88,13 +100,20 @@ findInternal(const LookupKeyT key_in) {
  *   this will be the previously inserted value, and if the map is full it is
  *   default.
  */
  *   this will be the previously inserted value, and if the map is full it is
  *   default.
  */
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
-template <typename LookupKeyT,
-          typename LookupHashFcn,
-          typename LookupEqualFcn,
-          typename LookupKeyToKeyFcn,
-          typename... ArgTs>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
+template <
+    typename LookupKeyT,
+    typename LookupHashFcn,
+    typename LookupEqualFcn,
+    typename LookupKeyToKeyFcn,
+    typename... ArgTs>
 typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                          Allocator, ProbeFcn, KeyConvertFcn>::SimpleRetT
 AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
 typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                          Allocator, ProbeFcn, KeyConvertFcn>::SimpleRetT
 AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
@@ -222,8 +241,14 @@ insertInternal(LookupKeyT key_in, ArgTs&&... vCtorArgs) {
  *   erased key will never be reused. If there's an associated value, we won't
  *   touch it either.
  */
  *   erased key will never be reused. If there's an associated value, we won't
  *   touch it either.
  */
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 size_t AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
 erase(KeyT key_in) {
 size_t AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
 erase(KeyT key_in) {
@@ -271,8 +296,14 @@ erase(KeyT key_in) {
   }
 }
 
   }
 }
 
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-         class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                          Allocator, ProbeFcn, KeyConvertFcn>::SmartPtr
 AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
 typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                          Allocator, ProbeFcn, KeyConvertFcn>::SmartPtr
 AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
@@ -314,8 +345,14 @@ create(size_t maxSize, const Config& c) {
   return map;
 }
 
   return map;
 }
 
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 destroy(AtomicHashArray* p) {
 void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 destroy(AtomicHashArray* p) {
@@ -334,8 +371,14 @@ destroy(AtomicHashArray* p) {
 }
 
 // clear -- clears all keys and values in the map and resets all counters
 }
 
 // clear -- clears all keys and values in the map and resets all counters
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 clear() {
 void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 clear() {
@@ -355,8 +398,14 @@ clear() {
 
 // Iterator implementation
 
 
 // Iterator implementation
 
-template <class KeyT, class ValueT, class HashFcn, class EqualFcn,
-          class Allocator, class ProbeFcn, class KeyConvertFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn,
+    class EqualFcn,
+    class Allocator,
+    class ProbeFcn,
+    class KeyConvertFcn>
 template <class ContT, class IterVal>
 struct AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
 template <class ContT, class IterVal>
 struct AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
index 3e151afc00f383cbaa22610025b1166719ebf2e0..897bf8a84c82def72a2ad5471a5bb88afb2357f8 100644 (file)
@@ -209,17 +209,19 @@ class AtomicHashArray : boost::noncopyable {
    *
    *   See folly/test/ArrayHashArrayTest.cpp for sample usage.
    */
    *
    *   See folly/test/ArrayHashArrayTest.cpp for sample usage.
    */
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal>
   iterator find(LookupKeyT k) {
     return iterator(this,
         findInternal<LookupKeyT, LookupHashFcn, LookupEqualFcn>(k).idx);
   }
 
   iterator find(LookupKeyT k) {
     return iterator(this,
         findInternal<LookupKeyT, LookupHashFcn, LookupEqualFcn>(k).idx);
   }
 
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal>
   const_iterator find(LookupKeyT k) const {
     return const_cast<AtomicHashArray*>(this)->
       find<LookupKeyT, LookupHashFcn, LookupEqualFcn>(k);
   const_iterator find(LookupKeyT k) const {
     return const_cast<AtomicHashArray*>(this)->
       find<LookupKeyT, LookupHashFcn, LookupEqualFcn>(k);
@@ -254,11 +256,12 @@ class AtomicHashArray : boost::noncopyable {
    *   equal key is already present, this method converts 'key_in' to a key of
    *   type KeyT using the provided LookupKeyToKeyFcn.
    */
    *   equal key is already present, this method converts 'key_in' to a key of
    *   type KeyT using the provided LookupKeyToKeyFcn.
    */
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal,
-            typename LookupKeyToKeyFcn = key_convert,
-            typename... ArgTs>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal,
+      typename LookupKeyToKeyFcn = key_convert,
+      typename... ArgTs>
   std::pair<iterator,bool> emplace(LookupKeyT key_in, ArgTs&&... vCtorArgs) {
     SimpleRetT ret = insertInternal<LookupKeyT,
                                     LookupHashFcn,
   std::pair<iterator,bool> emplace(LookupKeyT key_in, ArgTs&&... vCtorArgs) {
     SimpleRetT ret = insertInternal<LookupKeyT,
                                     LookupHashFcn,
@@ -350,9 +353,10 @@ friend class AtomicHashMap<KeyT,
       typename... ArgTs>
   SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs);
 
       typename... ArgTs>
   SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs);
 
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal>
   SimpleRetT findInternal(const LookupKeyT key);
 
   template <typename MaybeKeyT>
   SimpleRetT findInternal(const LookupKeyT key);
 
   template <typename MaybeKeyT>
index 25ca05e11da0647ce53372169c6f339b8a3e4069..2dc552559b36bce0e660d07eaf05c92b8ce9eaa3 100644 (file)
@@ -54,18 +54,20 @@ AtomicHashMap<
 }
 
 // emplace --
 }
 
 // emplace --
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
-template <typename LookupKeyT,
-          typename LookupHashFcn,
-          typename LookupEqualFcn,
-          typename LookupKeyToKeyFcn,
-          typename... ArgTs>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
+template <
+    typename LookupKeyT,
+    typename LookupHashFcn,
+    typename LookupEqualFcn,
+    typename LookupKeyToKeyFcn,
+    typename... ArgTs>
 std::pair<typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator,
                                  ProbeFcn, KeyConvertFcn>::iterator, bool>
 AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
 std::pair<typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, Allocator,
                                  ProbeFcn, KeyConvertFcn>::iterator, bool>
 AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
@@ -82,18 +84,20 @@ emplace(LookupKeyT k, ArgTs&&... vCtorArgs) {
 }
 
 // insertInternal -- Allocates new sub maps as existing ones fill up.
 }
 
 // insertInternal -- Allocates new sub maps as existing ones fill up.
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
-template <typename LookupKeyT,
-          typename LookupHashFcn,
-          typename LookupEqualFcn,
-          typename LookupKeyToKeyFcn,
-          typename... ArgTs>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
+template <
+    typename LookupKeyT,
+    typename LookupHashFcn,
+    typename LookupEqualFcn,
+    typename LookupKeyToKeyFcn,
+    typename... ArgTs>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
     SimpleRetT
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
     SimpleRetT
@@ -176,13 +180,14 @@ insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs) {
 }
 
 // find --
 }
 
 // find --
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
@@ -198,13 +203,14 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
   return iterator(this, ret.i, subMap->makeIter(ret.j));
 }
 
   return iterator(this, ret.i, subMap->makeIter(ret.j));
 }
 
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashMap<KeyT, ValueT,
          HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn>::const_iterator
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashMap<KeyT, ValueT,
          HashFcn, EqualFcn, Allocator, ProbeFcn, KeyConvertFcn>::const_iterator
@@ -217,13 +223,14 @@ find(LookupKeyT k) const {
 }
 
 // findInternal --
 }
 
 // findInternal --
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
 template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
@@ -256,13 +263,14 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
 }
 
 // findAtInternal -- see encodeIndex() for details.
 }
 
 // findAtInternal -- see encodeIndex() for details.
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
     SimpleRetT
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
     SimpleRetT
@@ -285,13 +293,14 @@ findAtInternal(uint32_t idx) const {
 }
 
 // erase --
 }
 
 // erase --
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
     size_type
 typename AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                        Allocator, ProbeFcn, KeyConvertFcn>::
     size_type
@@ -310,13 +319,14 @@ erase(const KeyT k) {
 }
 
 // capacity -- summation of capacities of all submaps
 }
 
 // capacity -- summation of capacities of all submaps
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 size_t AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 capacity() const {
 size_t AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 capacity() const {
@@ -330,13 +340,14 @@ capacity() const {
 
 // spaceRemaining --
 // number of new insertions until current submaps are all at max load
 
 // spaceRemaining --
 // number of new insertions until current submaps are all at max load
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 size_t AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 spaceRemaining() const {
 size_t AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 spaceRemaining() const {
@@ -354,13 +365,14 @@ spaceRemaining() const {
 
 // clear -- Wipes all keys and values from primary map and destroys
 // all secondary maps.  Not thread safe.
 
 // clear -- Wipes all keys and values from primary map and destroys
 // all secondary maps.  Not thread safe.
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 void AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                    Allocator, ProbeFcn, KeyConvertFcn>::
 clear() {
 void AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                    Allocator, ProbeFcn, KeyConvertFcn>::
 clear() {
@@ -377,13 +389,14 @@ clear() {
 }
 
 // size --
 }
 
 // size --
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 size_t AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 size() const {
 size_t AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 size() const {
@@ -413,13 +426,14 @@ size() const {
 //         31              1
 //      27-30   which subMap
 //       0-26  subMap offset (index_ret input)
 //         31              1
 //      27-30   which subMap
 //       0-26  subMap offset (index_ret input)
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 inline uint32_t
 AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
               Allocator, ProbeFcn, KeyConvertFcn>::
 inline uint32_t
 AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
               Allocator, ProbeFcn, KeyConvertFcn>::
@@ -438,13 +452,14 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
 
 // Iterator implementation
 
 
 // Iterator implementation
 
-template <typename KeyT,
-          typename ValueT,
-          typename HashFcn,
-          typename EqualFcn,
-          typename Allocator,
-          typename ProbeFcn,
-          typename KeyConvertFcn>
+template <
+    typename KeyT,
+    typename ValueT,
+    typename HashFcn,
+    typename EqualFcn,
+    typename Allocator,
+    typename ProbeFcn,
+    typename KeyConvertFcn>
 template <class ContT, class IterVal, class SubIt>
 struct AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
 template <class ContT, class IterVal, class SubIt>
 struct AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
                      Allocator, ProbeFcn, KeyConvertFcn>::
index be683e58a90fd7d2c9131d4593fb1803d1ade30c..af8aa633f4a66c7409d2d7f245564e8c59a5a3e4 100644 (file)
@@ -254,11 +254,12 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
    *   equal key is already present, this method converts 'key_in' to a key of
    *   type KeyT using the provided LookupKeyToKeyFcn.
    */
    *   equal key is already present, this method converts 'key_in' to a key of
    *   type KeyT using the provided LookupKeyToKeyFcn.
    */
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal,
-            typename LookupKeyToKeyFcn = key_convert,
-            typename... ArgTs>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal,
+      typename LookupKeyToKeyFcn = key_convert,
+      typename... ArgTs>
   std::pair<iterator,bool> emplace(LookupKeyT k, ArgTs&&... vCtorArg);
 
   /*
   std::pair<iterator,bool> emplace(LookupKeyT k, ArgTs&&... vCtorArg);
 
   /*
@@ -277,14 +278,16 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
    *
    *   See folly/test/ArrayHashMapTest.cpp for sample usage.
    */
    *
    *   See folly/test/ArrayHashMapTest.cpp for sample usage.
    */
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal>
   iterator find(LookupKeyT k);
 
   iterator find(LookupKeyT k);
 
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal>
   const_iterator find(LookupKeyT k) const;
 
   /*
   const_iterator find(LookupKeyT k) const;
 
   /*
@@ -437,16 +440,18 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
     SimpleRetT() = default;
   };
 
     SimpleRetT() = default;
   };
 
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal,
-            typename LookupKeyToKeyFcn = key_convert,
-            typename... ArgTs>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal,
+      typename LookupKeyToKeyFcn = key_convert,
+      typename... ArgTs>
   SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... value);
 
   SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... value);
 
-  template <typename LookupKeyT = key_type,
-            typename LookupHashFcn = hasher,
-            typename LookupEqualFcn = key_equal>
+  template <
+      typename LookupKeyT = key_type,
+      typename LookupHashFcn = hasher,
+      typename LookupEqualFcn = key_equal>
   SimpleRetT findInternal(const LookupKeyT k) const;
 
   SimpleRetT findAtInternal(uint32_t idx) const;
   SimpleRetT findInternal(const LookupKeyT k) const;
 
   SimpleRetT findAtInternal(uint32_t idx) const;
@@ -464,11 +469,12 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
 
 }; // AtomicHashMap
 
 
 }; // AtomicHashMap
 
-template <class KeyT,
-          class ValueT,
-          class HashFcn = std::hash<KeyT>,
-          class EqualFcn = std::equal_to<KeyT>,
-          class Allocator = std::allocator<char>>
+template <
+    class KeyT,
+    class ValueT,
+    class HashFcn = std::hash<KeyT>,
+    class EqualFcn = std::equal_to<KeyT>,
+    class Allocator = std::allocator<char>>
 using QuadraticProbingAtomicHashMap =
     AtomicHashMap<KeyT,
                   ValueT,
 using QuadraticProbingAtomicHashMap =
     AtomicHashMap<KeyT,
                   ValueT,
index ee39006d187deae36b065876c1bb7edcd84d9ba3..21cf55e069313bba7fbb38006be9b1f150d836ed 100644 (file)
@@ -479,15 +479,16 @@ struct AtomicUnorderedInsertMap {
 /// to select a 64 bit slot index type.  Use this if you need a capacity
 /// bigger than 2^30 (about a billion).  This increases memory overheads,
 /// obviously.
 /// to select a 64 bit slot index type.  Use this if you need a capacity
 /// bigger than 2^30 (about a billion).  This increases memory overheads,
 /// obviously.
-template <typename Key,
-          typename Value,
-          typename Hash = std::hash<Key>,
-          typename KeyEqual = std::equal_to<Key>,
-          bool SkipKeyValueDeletion =
-              (boost::has_trivial_destructor<Key>::value &&
-               boost::has_trivial_destructor<Value>::value),
-          template <typename> class Atom = std::atomic,
-          typename Allocator = folly::detail::MMapAlloc>
+template <
+    typename Key,
+    typename Value,
+    typename Hash = std::hash<Key>,
+    typename KeyEqual = std::equal_to<Key>,
+    bool SkipKeyValueDeletion =
+        (boost::has_trivial_destructor<Key>::value &&
+         boost::has_trivial_destructor<Value>::value),
+    template <typename> class Atom = std::atomic,
+    typename Allocator = folly::detail::MMapAlloc>
 using AtomicUnorderedInsertMap64 =
     AtomicUnorderedInsertMap<Key,
                              Value,
 using AtomicUnorderedInsertMap64 =
     AtomicUnorderedInsertMap<Key,
                              Value,
index a22dee196909cc406a0df78ecde36d8d86a7a286..e2579b72aa0a82d4fdcf006e23ac68ee479f10d8 100644 (file)
@@ -1045,10 +1045,11 @@ class dummy_fbstring_core {
 #ifdef _LIBSTDCXX_FBSTRING
 template <typename E, class T, class A, class Storage>
 #else
 #ifdef _LIBSTDCXX_FBSTRING
 template <typename E, class T, class A, class Storage>
 #else
-template <typename E,
-          class T = std::char_traits<E>,
-          class A = std::allocator<E>,
-          class Storage = fbstring_core<E> >
+template <
+    typename E,
+    class T = std::char_traits<E>,
+    class A = std::allocator<E>,
+    class Storage = fbstring_core<E>>
 #endif
 class basic_fbstring {
   static void enforce(
 #endif
 class basic_fbstring {
   static void enforce(
index 03c85e473c3bbdea95e1ee5187c7aba0b8d77d3e..b3564126600dbc09dff350d62ed9a03df18b8463 100644 (file)
@@ -1307,9 +1307,10 @@ struct SingleElementQueue {
   }
 
   /// enqueue using in-place noexcept construction
   }
 
   /// enqueue using in-place noexcept construction
-  template <typename ...Args,
-            typename = typename std::enable_if<
-              std::is_nothrow_constructible<T,Args...>::value>::type>
+  template <
+      typename... Args,
+      typename = typename std::enable_if<
+          std::is_nothrow_constructible<T, Args...>::value>::type>
   void enqueue(const uint32_t turn,
                Atom<uint32_t>& spinCutoff,
                const bool updateSpinCutoff,
   void enqueue(const uint32_t turn,
                Atom<uint32_t>& spinCutoff,
                const bool updateSpinCutoff,
index aaf30af721e161351e7a0505375a77ff395c00dc..b6e428ea32056ae7ff16042292bde961176f7915 100644 (file)
@@ -69,8 +69,9 @@ template <class Iter> class Range;
  * as Boyer-Moore. On the upside, it does not do any upfront
  * preprocessing and does not allocate memory.
  */
  * as Boyer-Moore. On the upside, it does not do any upfront
  * preprocessing and does not allocate memory.
  */
-template <class Iter,
-          class Comp = std::equal_to<typename Range<Iter>::value_type>>
+template <
+    class Iter,
+    class Comp = std::equal_to<typename Range<Iter>::value_type>>
 inline size_t qfind(const Range<Iter> & haystack,
                     const Range<Iter> & needle,
                     Comp eq = Comp());
 inline size_t qfind(const Range<Iter> & haystack,
                     const Range<Iter> & needle,
                     Comp eq = Comp());
index 163382ab34b8155dc7e0b60cd95f23ef4af76ce5..0968f5bad2d9516aa5594144ca83e11177d24ac3 100644 (file)
@@ -236,10 +236,11 @@ struct SharedMutexToken {
   uint16_t slot_;
 };
 
   uint16_t slot_;
 };
 
-template <bool ReaderPriority,
-          typename Tag_ = void,
-          template <typename> class Atom = std::atomic,
-          bool BlockImmediately = false>
+template <
+    bool ReaderPriority,
+    typename Tag_ = void,
+    template <typename> class Atom = std::atomic,
+    bool BlockImmediately = false>
 class SharedMutexImpl {
  public:
   static constexpr bool kReaderPriority = ReaderPriority;
 class SharedMutexImpl {
  public:
   static constexpr bool kReaderPriority = ReaderPriority;
index 64b6f37592580359c5124c46a0107706a545534b..975bab57d0bdab5d88de1cc94874cbe9d5870026 100644 (file)
@@ -532,9 +532,10 @@ class SingletonVault {
 // singletons.  Create instances of this class in the global scope of
 // type Singleton<T> to register your singleton for later access via
 // Singleton<T>::try_get().
 // singletons.  Create instances of this class in the global scope of
 // type Singleton<T> to register your singleton for later access via
 // Singleton<T>::try_get().
-template <typename T,
-          typename Tag = detail::DefaultTag,
-          typename VaultTag = detail::DefaultTag /* for testing */>
+template <
+    typename T,
+    typename Tag = detail::DefaultTag,
+    typename VaultTag = detail::DefaultTag /* for testing */>
 class Singleton {
  public:
   typedef std::function<T*(void)> CreateFunc;
 class Singleton {
  public:
   typedef std::function<T*(void)> CreateFunc;
index 5570b7b9b46af33d2dba9726415ebf21f9f01b86..53b54f42f8c7f022643941431341fc5bd2c98842 100644 (file)
@@ -561,11 +561,12 @@ std::string join(const Delim& delimiter,
   return output;
 }
 
   return output;
 }
 
-template <class Delim,
-          class Iterator,
-          typename std::enable_if<std::is_same<
-              typename std::iterator_traits<Iterator>::iterator_category,
-              std::random_access_iterator_tag>::value>::type* = nullptr>
+template <
+    class Delim,
+    class Iterator,
+    typename std::enable_if<std::is_same<
+        typename std::iterator_traits<Iterator>::iterator_category,
+        std::random_access_iterator_tag>::value>::type* = nullptr>
 std::string join(const Delim& delimiter, Iterator begin, Iterator end) {
   std::string output;
   join(delimiter, begin, end, output);
 std::string join(const Delim& delimiter, Iterator begin, Iterator end) {
   std::string output;
   join(delimiter, begin, end, output);
@@ -625,8 +626,9 @@ inline void toLowerAscii(MutableStringPiece str) {
   toLowerAscii(str.begin(), str.size());
 }
 
   toLowerAscii(str.begin(), str.size());
 }
 
-template <class Iterator = const char*,
-          class Base = folly::Range<boost::u8_to_u32_iterator<Iterator>>>
+template <
+    class Iterator = const char*,
+    class Base = folly::Range<boost::u8_to_u32_iterator<Iterator>>>
 class UTF8Range : public Base {
  public:
   /* implicit */ UTF8Range(const folly::Range<Iterator> baseRange)
 class UTF8Range : public Base {
  public:
   /* implicit */ UTF8Range(const folly::Range<Iterator> baseRange)
index c7a35297be2796da51f266d6c904c55e5bca17b5..fcbde0027a4ee0101bb6f9fe210a56891d25fb71 100644 (file)
@@ -110,14 +110,15 @@ struct MemoryIdler {
   /// (1 + timeoutVariationFraction), to smooth out the behavior in a
   /// system with bursty requests.  The default is to wait up to 50%
   /// extra, so on average 25% extra
   /// (1 + timeoutVariationFraction), to smooth out the behavior in a
   /// system with bursty requests.  The default is to wait up to 50%
   /// extra, so on average 25% extra
-  template <template <typename> class Atom,
-            typename Clock = std::chrono::steady_clock>
+  template <
+      template <typename> class Atom,
+      typename Clock = std::chrono::steady_clock>
   static bool futexWait(
       Futex<Atom>& fut,
       uint32_t expected,
       uint32_t waitMask = -1,
   static bool futexWait(
       Futex<Atom>& fut,
       uint32_t expected,
       uint32_t waitMask = -1,
-      typename Clock::duration idleTimeout
-          defaultIdleTimeout.load(std::memory_order_acquire),
+      typename Clock::duration idleTimeout =
+          defaultIdleTimeout.load(std::memory_order_acquire),
       size_t stackToRetain = kDefaultStackToRetain,
       float timeoutVariationFrac = 0.5) {
 
       size_t stackToRetain = kDefaultStackToRetain,
       float timeoutVariationFrac = 0.5) {
 
index 7561ae6c94e6dbf73407aabe0462e6a04d527c35..38dde11ae2969595a2e84829541f0ce9c4322ee9 100644 (file)
@@ -70,10 +70,11 @@ struct BitVectorCompressedListBase {
 typedef BitVectorCompressedListBase<const uint8_t*> BitVectorCompressedList;
 typedef BitVectorCompressedListBase<uint8_t*> MutableBitVectorCompressedList;
 
 typedef BitVectorCompressedListBase<const uint8_t*> BitVectorCompressedList;
 typedef BitVectorCompressedListBase<uint8_t*> MutableBitVectorCompressedList;
 
-template <class Value,
-          class SkipValue,
-          size_t kSkipQuantum = 0,
-          size_t kForwardQuantum = 0>
+template <
+    class Value,
+    class SkipValue,
+    size_t kSkipQuantum = 0,
+    size_t kForwardQuantum = 0>
 struct BitVectorEncoder {
   static_assert(std::is_integral<Value>::value &&
                     std::is_unsigned<Value>::value,
 struct BitVectorEncoder {
   static_assert(std::is_integral<Value>::value &&
                     std::is_unsigned<Value>::value,
@@ -165,10 +166,11 @@ struct BitVectorEncoder {
   MutableCompressedList result_;
 };
 
   MutableCompressedList result_;
 };
 
-template <class Value,
-          class SkipValue,
-          size_t kSkipQuantum,
-          size_t kForwardQuantum>
+template <
+    class Value,
+    class SkipValue,
+    size_t kSkipQuantum,
+    size_t kForwardQuantum>
 struct BitVectorEncoder<Value, SkipValue, kSkipQuantum, kForwardQuantum>::
     Layout {
   static Layout fromUpperBoundAndSize(size_t upperBound, size_t size) {
 struct BitVectorEncoder<Value, SkipValue, kSkipQuantum, kForwardQuantum>::
     Layout {
   static Layout fromUpperBoundAndSize(size_t upperBound, size_t size) {
index aa4d402965aaf7d75deba68900dab891dd389b09..20d106a218f9eded8894e69a2be332bd94f2aa98 100644 (file)
@@ -86,10 +86,11 @@ struct EliasFanoCompressedListBase {
 typedef EliasFanoCompressedListBase<const uint8_t*> EliasFanoCompressedList;
 typedef EliasFanoCompressedListBase<uint8_t*> MutableEliasFanoCompressedList;
 
 typedef EliasFanoCompressedListBase<const uint8_t*> EliasFanoCompressedList;
 typedef EliasFanoCompressedListBase<uint8_t*> MutableEliasFanoCompressedList;
 
-template <class Value,
-          class SkipValue = size_t,
-          size_t kSkipQuantum = 0,     // 0 = disabled
-          size_t kForwardQuantum = 0>  // 0 = disabled
+template <
+    class Value,
+    class SkipValue = size_t,
+    size_t kSkipQuantum = 0, // 0 = disabled
+    size_t kForwardQuantum = 0> // 0 = disabled
 struct EliasFanoEncoderV2 {
   static_assert(std::is_integral<Value>::value &&
                     std::is_unsigned<Value>::value,
 struct EliasFanoEncoderV2 {
   static_assert(std::is_integral<Value>::value &&
                     std::is_unsigned<Value>::value,
@@ -216,10 +217,11 @@ struct EliasFanoEncoderV2 {
   MutableCompressedList result_;
 };
 
   MutableCompressedList result_;
 };
 
-template <class Value,
-          class SkipValue,
-          size_t kSkipQuantum,
-          size_t kForwardQuantum>
+template <
+    class Value,
+    class SkipValue,
+    size_t kSkipQuantum,
+    size_t kForwardQuantum>
 struct EliasFanoEncoderV2<Value,
                           SkipValue,
                           kSkipQuantum,
 struct EliasFanoEncoderV2<Value,
                           SkipValue,
                           kSkipQuantum,
index b6479993d4494bc358d22ffc7f237aef20bb9554..d828d65e30c95111a5e57920ee4891b7f3bff27c 100644 (file)
@@ -34,9 +34,10 @@ namespace folly {
  * It uses kind of hack: string pointed by StringPiece is copied when
  * StringPiece is inserted into map
  */
  * It uses kind of hack: string pointed by StringPiece is copied when
  * StringPiece is inserted into map
  */
-template <class Value,
-          class Compare = std::less<StringPiece>,
-          class Alloc = std::allocator<std::pair<const StringPiece, Value>>>
+template <
+    class Value,
+    class Compare = std::less<StringPiece>,
+    class Alloc = std::allocator<std::pair<const StringPiece, Value>>>
 class StringKeyedMap
     : private std::map<StringPiece, Value, Compare, Alloc> {
  private:
 class StringKeyedMap
     : private std::map<StringPiece, Value, Compare, Alloc> {
  private:
index 805e53146ba1bdce55545156c223e36ed5bfda41..a4befc0172c39968efe36f9ed11287b6585200e9 100644 (file)
@@ -34,8 +34,9 @@ namespace folly {
  * It uses kind of hack: string pointed by StringPiece is copied when
  * StringPiece is inserted into set
  */
  * It uses kind of hack: string pointed by StringPiece is copied when
  * StringPiece is inserted into set
  */
-template <class Compare = std::less<StringPiece>,
-          class Alloc = std::allocator<StringPiece>>
+template <
+    class Compare = std::less<StringPiece>,
+    class Alloc = std::allocator<StringPiece>>
 class StringKeyedSetBase
     : private std::set<StringPiece, Compare, Alloc> {
  private:
 class StringKeyedSetBase
     : private std::set<StringPiece, Compare, Alloc> {
  private:
index ac08f512da2f8147a9bec556be6afecd36257179..9397d90e320be5179f76c150fa972c99057ddffd 100644 (file)
@@ -66,12 +66,13 @@ struct TemplateRange<
 // where k = min(tuple_size<T>::value - start, n)
 // (that is, it's a TemplateSeq of at most n elements, but won't extend
 // past the end of the given tuple)
 // where k = min(tuple_size<T>::value - start, n)
 // (that is, it's a TemplateSeq of at most n elements, but won't extend
 // past the end of the given tuple)
-template <class T,
-          std::size_t start = 0,
-          std::size_t n = std::numeric_limits<std::size_t>::max(),
-          std::size_t size =
-            std::tuple_size<typename std::remove_reference<T>::type>::value,
-          class Enable = typename std::enable_if<(start <= size)>::type>
+template <
+    class T,
+    std::size_t start = 0,
+    std::size_t n = std::numeric_limits<std::size_t>::max(),
+    std::size_t size =
+        std::tuple_size<typename std::remove_reference<T>::type>::value,
+    class Enable = typename std::enable_if<(start <= size)>::type>
 struct TemplateTupleRange {
   using type = typename TemplateRange<
       std::size_t,
 struct TemplateTupleRange {
   using type = typename TemplateRange<
       std::size_t,
index 899d1c74575c29ad88be45a04ab3aa56d7fe7cbb..586a6549117420e0b661062fe6bfe824e8984af2 100644 (file)
@@ -119,10 +119,12 @@ struct TupleTo2<TemplateSeq<std::size_t, Ns...>> {
   }
 };
 
   }
 };
 
-template <class U, class T,
-          class Seq = typename TemplateTupleRange<U>::type,
-          class Enable = typename std::enable_if<
-            (std::tuple_size<U>::value == std::tuple_size<T>::value)>::type>
+template <
+    class U,
+    class T,
+    class Seq = typename TemplateTupleRange<U>::type,
+    class Enable = typename std::enable_if<
+        (std::tuple_size<U>::value == std::tuple_size<T>::value)>::type>
 U tupleTo2(const T& input) {
   return TupleTo2<Seq>::template convert<U>(input);
 }
 U tupleTo2(const T& input) {
   return TupleTo2<Seq>::template convert<U>(input);
 }
index 15afd34371eef79ba2b804bfe91919b9f847e7d0..0eae4dd12006544f4a1c40a37dde24f8bbcd5c79 100644 (file)
@@ -439,8 +439,11 @@ void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& /* ctx */) {
   // base case
 }
 
   // base case
 }
 
-template <template <typename ...> class T, typename... Ts,
-          typename THead, typename... TTail>
+template <
+    template <typename...> class T,
+    typename... Ts,
+    typename THead,
+    typename... TTail>
 void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& ctx,
                            THead&& head, TTail&&... tail) {
   using ValueType = typename std::decay<THead>::type::value_type;
 void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& ctx,
                            THead&& head, TTail&&... tail) {
   using ValueType = typename std::decay<THead>::type::value_type;
index 4366d5915f676d89cc70e0f061b2ca634c6b60aa..2dc55d1bb615114303829af90a1706682f3f6c58 100644 (file)
@@ -93,10 +93,12 @@ namespace futures {
    * Set func as the callback for each input Future and return a vector of
    * Futures containing the results in the input order.
    */
    * Set func as the callback for each input Future and return a vector of
    * Futures containing the results in the input order.
    */
-  template <class It, class F,
-            class ItT = typename std::iterator_traits<It>::value_type,
-            class Result
-      = typename decltype(std::declval<ItT>().then(std::declval<F>()))::value_type>
+  template <
+      class It,
+      class F,
+      class ItT = typename std::iterator_traits<It>::value_type,
+      class Result = typename decltype(
+          std::declval<ItT>().then(std::declval<F>()))::value_type>
   std::vector<Future<Result>> map(It first, It last, F func);
 
   // Sugar for the most common case
   std::vector<Future<Result>> map(It first, It last, F func);
 
   // Sugar for the most common case
@@ -363,9 +365,12 @@ auto reduce(Collection&& c, T&& initial, F&& func)
 /** like reduce, but calls func on finished futures as they complete
     does NOT keep the order of the input
   */
 /** like reduce, but calls func on finished futures as they complete
     does NOT keep the order of the input
   */
-template <class It, class T, class F,
-          class ItT = typename std::iterator_traits<It>::value_type::value_type,
-          class Arg = MaybeTryArg<F, T, ItT>>
+template <
+    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);
 
 /// Sugar for the most common case
 Future<T> unorderedReduce(It first, It last, T initial, F func);
 
 /// Sugar for the most common case
index d2bda88b8263e14becf8db994222838bf597d287..780076a1abcd402d1caaf600463814bebedb6069 100644 (file)
@@ -89,10 +89,11 @@ pair<KeyT,ValueT> createEntry(int i) {
                            to<ValueT>(i + 3));
 }
 
                            to<ValueT>(i + 3));
 }
 
-template <class KeyT,
-          class ValueT,
-          class Allocator = std::allocator<char>,
-          class ProbeFcn = AtomicHashArrayLinearProbeFcn>
+template <
+    class KeyT,
+    class ValueT,
+    class Allocator = std::allocator<char>,
+    class ProbeFcn = AtomicHashArrayLinearProbeFcn>
 void testMap() {
   typedef AtomicHashArray<KeyT, ValueT, std::hash<KeyT>,
                           std::equal_to<KeyT>, Allocator, ProbeFcn> MyArr;
 void testMap() {
   typedef AtomicHashArray<KeyT, ValueT, std::hash<KeyT>,
                           std::equal_to<KeyT>, Allocator, ProbeFcn> MyArr;
index 8b50e0c6d614f3e1beae2069c1c58d53f6bd51b0..342f0b87799ded6f9fd86ead29155e2e6255c975 100644 (file)
@@ -88,11 +88,12 @@ struct non_atomic {
   bool is_lock_free() const {return true;}
 };
 
   bool is_lock_free() const {return true;}
 };
 
-template <typename Key,
-          typename Value,
-          typename IndexType,
-          template <typename> class Atom = std::atomic,
-          typename Allocator = std::allocator<char>>
+template <
+    typename Key,
+    typename Value,
+    typename IndexType,
+    template <typename> class Atom = std::atomic,
+    typename Allocator = std::allocator<char>>
 using UIM =
     AtomicUnorderedInsertMap<Key,
                              Value,
 using UIM =
     AtomicUnorderedInsertMap<Key,
                              Value,
index 50d1de5dc1de2e33cf0f76fdafe4d7e7609eb032..0874a8f2f8e6c05ed168f8474a1f257091f4a58f 100644 (file)
@@ -381,9 +381,10 @@ struct WriteCaller : public WriteMethodCaller<Q> {
   string methodName() override { return "write"; }
 };
 
   string methodName() override { return "write"; }
 };
 
-template <typename Q,
-          class Clock = steady_clock,
-          class Duration = typename Clock::duration>
+template <
+    typename Q,
+    class Clock = steady_clock,
+    class Duration = typename Clock::duration>
 struct TryWriteUntilCaller : public WriteMethodCaller<Q> {
   const Duration duration_;
   explicit TryWriteUntilCaller(Duration&& duration) : duration_(duration) {}
 struct TryWriteUntilCaller : public WriteMethodCaller<Q> {
   const Duration duration_;
   explicit TryWriteUntilCaller(Duration&& duration) : duration_(duration) {}