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

Formatting for template parameters

Summary: [Folly] Formatting for template parameters.

Reviewed By: Orvid

Differential Revision: D5525123

fbshipit-source-id: 4feb772300cfdd6ae3168fe9f59f5a951fb85d0e
parent da591fe6
...@@ -26,8 +26,14 @@ ...@@ -26,8 +26,14 @@
namespace folly { namespace folly {
// AtomicHashArray private constructor -- // AtomicHashArray private constructor --
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>:: Allocator, ProbeFcn, KeyConvertFcn>::
AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey, AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
...@@ -46,8 +52,14 @@ 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 * of key and returns true, or if key does not exist returns false and
* ret.index is set to capacity_. * ret.index is set to capacity_.
*/ */
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn> template <class LookupKeyT, class LookupHashFcn, class LookupEqualFcn>
typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>::SimpleRetT Allocator, ProbeFcn, KeyConvertFcn>::SimpleRetT
...@@ -88,9 +100,16 @@ findInternal(const LookupKeyT key_in) { ...@@ -88,9 +100,16 @@ findInternal(const LookupKeyT key_in) {
* this will be the previously inserted value, and if the map is full it is * this will be the previously inserted value, and if the map is full it is
* default. * default.
*/ */
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
template <typename LookupKeyT, class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
template <
typename LookupKeyT,
typename LookupHashFcn, typename LookupHashFcn,
typename LookupEqualFcn, typename LookupEqualFcn,
typename LookupKeyToKeyFcn, typename LookupKeyToKeyFcn,
...@@ -222,8 +241,14 @@ insertInternal(LookupKeyT key_in, ArgTs&&... vCtorArgs) { ...@@ -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 * erased key will never be reused. If there's an associated value, we won't
* touch it either. * touch it either.
*/ */
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
size_t AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, size_t AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>:: Allocator, ProbeFcn, KeyConvertFcn>::
erase(KeyT key_in) { erase(KeyT key_in) {
...@@ -271,8 +296,14 @@ erase(KeyT key_in) { ...@@ -271,8 +296,14 @@ erase(KeyT key_in) {
} }
} }
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, typename AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>::SmartPtr Allocator, ProbeFcn, KeyConvertFcn>::SmartPtr
AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
...@@ -314,8 +345,14 @@ create(size_t maxSize, const Config& c) { ...@@ -314,8 +345,14 @@ create(size_t maxSize, const Config& c) {
return map; return map;
} }
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>:: Allocator, ProbeFcn, KeyConvertFcn>::
destroy(AtomicHashArray* p) { destroy(AtomicHashArray* p) {
...@@ -334,8 +371,14 @@ 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, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, void AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>:: Allocator, ProbeFcn, KeyConvertFcn>::
clear() { clear() {
...@@ -355,8 +398,14 @@ clear() { ...@@ -355,8 +398,14 @@ clear() {
// Iterator implementation // Iterator implementation
template <class KeyT, class ValueT, class HashFcn, class EqualFcn, template <
class Allocator, class ProbeFcn, class KeyConvertFcn> class KeyT,
class ValueT,
class HashFcn,
class EqualFcn,
class Allocator,
class ProbeFcn,
class KeyConvertFcn>
template <class ContT, class IterVal> template <class ContT, class IterVal>
struct AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, struct AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
Allocator, ProbeFcn, KeyConvertFcn>:: Allocator, ProbeFcn, KeyConvertFcn>::
......
...@@ -209,7 +209,8 @@ class AtomicHashArray : boost::noncopyable { ...@@ -209,7 +209,8 @@ 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, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal> typename LookupEqualFcn = key_equal>
iterator find(LookupKeyT k) { iterator find(LookupKeyT k) {
...@@ -217,7 +218,8 @@ class AtomicHashArray : boost::noncopyable { ...@@ -217,7 +218,8 @@ class AtomicHashArray : boost::noncopyable {
findInternal<LookupKeyT, LookupHashFcn, LookupEqualFcn>(k).idx); findInternal<LookupKeyT, LookupHashFcn, LookupEqualFcn>(k).idx);
} }
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal> typename LookupEqualFcn = key_equal>
const_iterator find(LookupKeyT k) const { const_iterator find(LookupKeyT k) const {
...@@ -254,7 +256,8 @@ class AtomicHashArray : boost::noncopyable { ...@@ -254,7 +256,8 @@ class AtomicHashArray : boost::noncopyable {
* equal key is already present, this method converts 'key_in' to a key of * equal key is already present, this method converts 'key_in' to a key of
* type KeyT using the provided LookupKeyToKeyFcn. * type KeyT using the provided LookupKeyToKeyFcn.
*/ */
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal, typename LookupEqualFcn = key_equal,
typename LookupKeyToKeyFcn = key_convert, typename LookupKeyToKeyFcn = key_convert,
...@@ -350,7 +353,8 @@ friend class AtomicHashMap<KeyT, ...@@ -350,7 +353,8 @@ friend class AtomicHashMap<KeyT,
typename... ArgTs> typename... ArgTs>
SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs); SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs);
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal> typename LookupEqualFcn = key_equal>
SimpleRetT findInternal(const LookupKeyT key); SimpleRetT findInternal(const LookupKeyT key);
......
...@@ -54,14 +54,16 @@ AtomicHashMap< ...@@ -54,14 +54,16 @@ AtomicHashMap<
} }
// emplace -- // emplace --
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
typename Allocator, typename Allocator,
typename ProbeFcn, typename ProbeFcn,
typename KeyConvertFcn> typename KeyConvertFcn>
template <typename LookupKeyT, template <
typename LookupKeyT,
typename LookupHashFcn, typename LookupHashFcn,
typename LookupEqualFcn, typename LookupEqualFcn,
typename LookupKeyToKeyFcn, typename LookupKeyToKeyFcn,
...@@ -82,14 +84,16 @@ emplace(LookupKeyT k, ArgTs&&... vCtorArgs) { ...@@ -82,14 +84,16 @@ 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, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
typename Allocator, typename Allocator,
typename ProbeFcn, typename ProbeFcn,
typename KeyConvertFcn> typename KeyConvertFcn>
template <typename LookupKeyT, template <
typename LookupKeyT,
typename LookupHashFcn, typename LookupHashFcn,
typename LookupEqualFcn, typename LookupEqualFcn,
typename LookupKeyToKeyFcn, typename LookupKeyToKeyFcn,
...@@ -176,7 +180,8 @@ insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs) { ...@@ -176,7 +180,8 @@ insertInternal(LookupKeyT key, ArgTs&&... vCtorArgs) {
} }
// find -- // find --
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -198,7 +203,8 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -198,7 +203,8 @@ 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, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -217,7 +223,8 @@ find(LookupKeyT k) const { ...@@ -217,7 +223,8 @@ find(LookupKeyT k) const {
} }
// findInternal -- // findInternal --
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -256,7 +263,8 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -256,7 +263,8 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
} }
// findAtInternal -- see encodeIndex() for details. // findAtInternal -- see encodeIndex() for details.
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -285,7 +293,8 @@ findAtInternal(uint32_t idx) const { ...@@ -285,7 +293,8 @@ findAtInternal(uint32_t idx) const {
} }
// erase -- // erase --
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -310,7 +319,8 @@ erase(const KeyT k) { ...@@ -310,7 +319,8 @@ erase(const KeyT k) {
} }
// capacity -- summation of capacities of all submaps // capacity -- summation of capacities of all submaps
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -330,7 +340,8 @@ capacity() const { ...@@ -330,7 +340,8 @@ capacity() const {
// spaceRemaining -- // spaceRemaining --
// number of new insertions until current submaps are all at max load // number of new insertions until current submaps are all at max load
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -354,7 +365,8 @@ spaceRemaining() const { ...@@ -354,7 +365,8 @@ spaceRemaining() const {
// clear -- Wipes all keys and values from primary map and destroys // clear -- Wipes all keys and values from primary map and destroys
// all secondary maps. Not thread safe. // all secondary maps. Not thread safe.
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -377,7 +389,8 @@ clear() { ...@@ -377,7 +389,8 @@ clear() {
} }
// size -- // size --
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -413,7 +426,8 @@ size() const { ...@@ -413,7 +426,8 @@ size() const {
// 31 1 // 31 1
// 27-30 which subMap // 27-30 which subMap
// 0-26 subMap offset (index_ret input) // 0-26 subMap offset (index_ret input)
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
...@@ -438,7 +452,8 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -438,7 +452,8 @@ AtomicHashMap<KeyT, ValueT, HashFcn, EqualFcn,
// Iterator implementation // Iterator implementation
template <typename KeyT, template <
typename KeyT,
typename ValueT, typename ValueT,
typename HashFcn, typename HashFcn,
typename EqualFcn, typename EqualFcn,
......
...@@ -254,7 +254,8 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -254,7 +254,8 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
* equal key is already present, this method converts 'key_in' to a key of * equal key is already present, this method converts 'key_in' to a key of
* type KeyT using the provided LookupKeyToKeyFcn. * type KeyT using the provided LookupKeyToKeyFcn.
*/ */
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal, typename LookupEqualFcn = key_equal,
typename LookupKeyToKeyFcn = key_convert, typename LookupKeyToKeyFcn = key_convert,
...@@ -277,12 +278,14 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -277,12 +278,14 @@ 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, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal> typename LookupEqualFcn = key_equal>
iterator find(LookupKeyT k); iterator find(LookupKeyT k);
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal> typename LookupEqualFcn = key_equal>
const_iterator find(LookupKeyT k) const; const_iterator find(LookupKeyT k) const;
...@@ -437,14 +440,16 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -437,14 +440,16 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
SimpleRetT() = default; SimpleRetT() = default;
}; };
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal, typename LookupEqualFcn = key_equal,
typename LookupKeyToKeyFcn = key_convert, typename LookupKeyToKeyFcn = key_convert,
typename... ArgTs> typename... ArgTs>
SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... value); SimpleRetT insertInternal(LookupKeyT key, ArgTs&&... value);
template <typename LookupKeyT = key_type, template <
typename LookupKeyT = key_type,
typename LookupHashFcn = hasher, typename LookupHashFcn = hasher,
typename LookupEqualFcn = key_equal> typename LookupEqualFcn = key_equal>
SimpleRetT findInternal(const LookupKeyT k) const; SimpleRetT findInternal(const LookupKeyT k) const;
...@@ -464,7 +469,8 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, ...@@ -464,7 +469,8 @@ typedef AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn,
}; // AtomicHashMap }; // AtomicHashMap
template <class KeyT, template <
class KeyT,
class ValueT, class ValueT,
class HashFcn = std::hash<KeyT>, class HashFcn = std::hash<KeyT>,
class EqualFcn = std::equal_to<KeyT>, class EqualFcn = std::equal_to<KeyT>,
......
...@@ -479,7 +479,8 @@ struct AtomicUnorderedInsertMap { ...@@ -479,7 +479,8 @@ struct AtomicUnorderedInsertMap {
/// to select a 64 bit slot index type. Use this if you need a capacity /// 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, /// bigger than 2^30 (about a billion). This increases memory overheads,
/// obviously. /// obviously.
template <typename Key, template <
typename Key,
typename Value, typename Value,
typename Hash = std::hash<Key>, typename Hash = std::hash<Key>,
typename KeyEqual = std::equal_to<Key>, typename KeyEqual = std::equal_to<Key>,
......
...@@ -1045,10 +1045,11 @@ class dummy_fbstring_core { ...@@ -1045,10 +1045,11 @@ class dummy_fbstring_core {
#ifdef _LIBSTDCXX_FBSTRING #ifdef _LIBSTDCXX_FBSTRING
template <typename E, class T, class A, class Storage> template <typename E, class T, class A, class Storage>
#else #else
template <typename E, template <
typename E,
class T = std::char_traits<E>, class T = std::char_traits<E>,
class A = std::allocator<E>, class A = std::allocator<E>,
class Storage = fbstring_core<E> > class Storage = fbstring_core<E>>
#endif #endif
class basic_fbstring { class basic_fbstring {
static void enforce( static void enforce(
......
...@@ -1307,9 +1307,10 @@ struct SingleElementQueue { ...@@ -1307,9 +1307,10 @@ struct SingleElementQueue {
} }
/// enqueue using in-place noexcept construction /// enqueue using in-place noexcept construction
template <typename ...Args, template <
typename... Args,
typename = typename std::enable_if< typename = typename std::enable_if<
std::is_nothrow_constructible<T,Args...>::value>::type> std::is_nothrow_constructible<T, Args...>::value>::type>
void enqueue(const uint32_t turn, void enqueue(const uint32_t turn,
Atom<uint32_t>& spinCutoff, Atom<uint32_t>& spinCutoff,
const bool updateSpinCutoff, const bool updateSpinCutoff,
......
...@@ -69,7 +69,8 @@ template <class Iter> class Range; ...@@ -69,7 +69,8 @@ template <class Iter> class Range;
* as Boyer-Moore. On the upside, it does not do any upfront * as Boyer-Moore. On the upside, it does not do any upfront
* preprocessing and does not allocate memory. * preprocessing and does not allocate memory.
*/ */
template <class Iter, template <
class Iter,
class Comp = std::equal_to<typename Range<Iter>::value_type>> class Comp = std::equal_to<typename Range<Iter>::value_type>>
inline size_t qfind(const Range<Iter> & haystack, inline size_t qfind(const Range<Iter> & haystack,
const Range<Iter> & needle, const Range<Iter> & needle,
......
...@@ -236,7 +236,8 @@ struct SharedMutexToken { ...@@ -236,7 +236,8 @@ struct SharedMutexToken {
uint16_t slot_; uint16_t slot_;
}; };
template <bool ReaderPriority, template <
bool ReaderPriority,
typename Tag_ = void, typename Tag_ = void,
template <typename> class Atom = std::atomic, template <typename> class Atom = std::atomic,
bool BlockImmediately = false> bool BlockImmediately = false>
......
...@@ -532,7 +532,8 @@ class SingletonVault { ...@@ -532,7 +532,8 @@ class SingletonVault {
// singletons. Create instances of this class in the global scope of // singletons. Create instances of this class in the global scope of
// type Singleton<T> to register your singleton for later access via // type Singleton<T> to register your singleton for later access via
// Singleton<T>::try_get(). // Singleton<T>::try_get().
template <typename T, template <
typename T,
typename Tag = detail::DefaultTag, typename Tag = detail::DefaultTag,
typename VaultTag = detail::DefaultTag /* for testing */> typename VaultTag = detail::DefaultTag /* for testing */>
class Singleton { class Singleton {
......
...@@ -561,7 +561,8 @@ std::string join(const Delim& delimiter, ...@@ -561,7 +561,8 @@ std::string join(const Delim& delimiter,
return output; return output;
} }
template <class Delim, template <
class Delim,
class Iterator, class Iterator,
typename std::enable_if<std::is_same< typename std::enable_if<std::is_same<
typename std::iterator_traits<Iterator>::iterator_category, typename std::iterator_traits<Iterator>::iterator_category,
...@@ -625,7 +626,8 @@ inline void toLowerAscii(MutableStringPiece str) { ...@@ -625,7 +626,8 @@ inline void toLowerAscii(MutableStringPiece str) {
toLowerAscii(str.begin(), str.size()); toLowerAscii(str.begin(), str.size());
} }
template <class Iterator = const char*, template <
class Iterator = const char*,
class Base = folly::Range<boost::u8_to_u32_iterator<Iterator>>> class Base = folly::Range<boost::u8_to_u32_iterator<Iterator>>>
class UTF8Range : public Base { class UTF8Range : public Base {
public: public:
......
...@@ -110,14 +110,15 @@ struct MemoryIdler { ...@@ -110,14 +110,15 @@ struct MemoryIdler {
/// (1 + timeoutVariationFraction), to smooth out the behavior in a /// (1 + timeoutVariationFraction), to smooth out the behavior in a
/// system with bursty requests. The default is to wait up to 50% /// system with bursty requests. The default is to wait up to 50%
/// extra, so on average 25% extra /// extra, so on average 25% extra
template <template <typename> class Atom, template <
template <typename> class Atom,
typename Clock = std::chrono::steady_clock> typename Clock = std::chrono::steady_clock>
static bool futexWait( static bool futexWait(
Futex<Atom>& fut, Futex<Atom>& fut,
uint32_t expected, uint32_t expected,
uint32_t waitMask = -1, uint32_t waitMask = -1,
typename Clock::duration idleTimeout typename Clock::duration idleTimeout =
= defaultIdleTimeout.load(std::memory_order_acquire), defaultIdleTimeout.load(std::memory_order_acquire),
size_t stackToRetain = kDefaultStackToRetain, size_t stackToRetain = kDefaultStackToRetain,
float timeoutVariationFrac = 0.5) { float timeoutVariationFrac = 0.5) {
......
...@@ -70,7 +70,8 @@ struct BitVectorCompressedListBase { ...@@ -70,7 +70,8 @@ struct BitVectorCompressedListBase {
typedef BitVectorCompressedListBase<const uint8_t*> BitVectorCompressedList; typedef BitVectorCompressedListBase<const uint8_t*> BitVectorCompressedList;
typedef BitVectorCompressedListBase<uint8_t*> MutableBitVectorCompressedList; typedef BitVectorCompressedListBase<uint8_t*> MutableBitVectorCompressedList;
template <class Value, template <
class Value,
class SkipValue, class SkipValue,
size_t kSkipQuantum = 0, size_t kSkipQuantum = 0,
size_t kForwardQuantum = 0> size_t kForwardQuantum = 0>
...@@ -165,7 +166,8 @@ struct BitVectorEncoder { ...@@ -165,7 +166,8 @@ struct BitVectorEncoder {
MutableCompressedList result_; MutableCompressedList result_;
}; };
template <class Value, template <
class Value,
class SkipValue, class SkipValue,
size_t kSkipQuantum, size_t kSkipQuantum,
size_t kForwardQuantum> size_t kForwardQuantum>
......
...@@ -86,7 +86,8 @@ struct EliasFanoCompressedListBase { ...@@ -86,7 +86,8 @@ struct EliasFanoCompressedListBase {
typedef EliasFanoCompressedListBase<const uint8_t*> EliasFanoCompressedList; typedef EliasFanoCompressedListBase<const uint8_t*> EliasFanoCompressedList;
typedef EliasFanoCompressedListBase<uint8_t*> MutableEliasFanoCompressedList; typedef EliasFanoCompressedListBase<uint8_t*> MutableEliasFanoCompressedList;
template <class Value, template <
class Value,
class SkipValue = size_t, class SkipValue = size_t,
size_t kSkipQuantum = 0, // 0 = disabled size_t kSkipQuantum = 0, // 0 = disabled
size_t kForwardQuantum = 0> // 0 = disabled size_t kForwardQuantum = 0> // 0 = disabled
...@@ -216,7 +217,8 @@ struct EliasFanoEncoderV2 { ...@@ -216,7 +217,8 @@ struct EliasFanoEncoderV2 {
MutableCompressedList result_; MutableCompressedList result_;
}; };
template <class Value, template <
class Value,
class SkipValue, class SkipValue,
size_t kSkipQuantum, size_t kSkipQuantum,
size_t kForwardQuantum> size_t kForwardQuantum>
......
...@@ -34,7 +34,8 @@ namespace folly { ...@@ -34,7 +34,8 @@ namespace folly {
* It uses kind of hack: string pointed by StringPiece is copied when * It uses kind of hack: string pointed by StringPiece is copied when
* StringPiece is inserted into map * StringPiece is inserted into map
*/ */
template <class Value, template <
class Value,
class Compare = std::less<StringPiece>, class Compare = std::less<StringPiece>,
class Alloc = std::allocator<std::pair<const StringPiece, Value>>> class Alloc = std::allocator<std::pair<const StringPiece, Value>>>
class StringKeyedMap class StringKeyedMap
......
...@@ -34,7 +34,8 @@ namespace folly { ...@@ -34,7 +34,8 @@ namespace folly {
* It uses kind of hack: string pointed by StringPiece is copied when * It uses kind of hack: string pointed by StringPiece is copied when
* StringPiece is inserted into set * StringPiece is inserted into set
*/ */
template <class Compare = std::less<StringPiece>, template <
class Compare = std::less<StringPiece>,
class Alloc = std::allocator<StringPiece>> class Alloc = std::allocator<StringPiece>>
class StringKeyedSetBase class StringKeyedSetBase
: private std::set<StringPiece, Compare, Alloc> { : private std::set<StringPiece, Compare, Alloc> {
......
...@@ -66,7 +66,8 @@ struct TemplateRange< ...@@ -66,7 +66,8 @@ struct TemplateRange<
// where k = min(tuple_size<T>::value - start, n) // where k = min(tuple_size<T>::value - start, n)
// (that is, it's a TemplateSeq of at most n elements, but won't extend // (that is, it's a TemplateSeq of at most n elements, but won't extend
// past the end of the given tuple) // past the end of the given tuple)
template <class T, template <
class T,
std::size_t start = 0, std::size_t start = 0,
std::size_t n = std::numeric_limits<std::size_t>::max(), std::size_t n = std::numeric_limits<std::size_t>::max(),
std::size_t size = std::size_t size =
......
...@@ -119,7 +119,9 @@ struct TupleTo2<TemplateSeq<std::size_t, Ns...>> { ...@@ -119,7 +119,9 @@ struct TupleTo2<TemplateSeq<std::size_t, Ns...>> {
} }
}; };
template <class U, class T, template <
class U,
class T,
class Seq = typename TemplateTupleRange<U>::type, class Seq = typename TemplateTupleRange<U>::type,
class Enable = typename std::enable_if< class Enable = typename std::enable_if<
(std::tuple_size<U>::value == std::tuple_size<T>::value)>::type> (std::tuple_size<U>::value == std::tuple_size<T>::value)>::type>
......
...@@ -439,8 +439,11 @@ void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& /* ctx */) { ...@@ -439,8 +439,11 @@ void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& /* ctx */) {
// base case // base case
} }
template <template <typename ...> class T, typename... Ts, template <
typename THead, typename... TTail> template <typename...> class T,
typename... Ts,
typename THead,
typename... TTail>
void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& ctx, void collectVariadicHelper(const std::shared_ptr<T<Ts...>>& ctx,
THead&& head, TTail&&... tail) { THead&& head, TTail&&... tail) {
using ValueType = typename std::decay<THead>::type::value_type; using ValueType = typename std::decay<THead>::type::value_type;
......
...@@ -93,10 +93,12 @@ namespace futures { ...@@ -93,10 +93,12 @@ namespace futures {
* Set func as the callback for each input Future and return a vector of * Set func as the callback for each input Future and return a vector of
* Futures containing the results in the input order. * Futures containing the results in the input order.
*/ */
template <class It, class F, template <
class It,
class F,
class ItT = typename std::iterator_traits<It>::value_type, class ItT = typename std::iterator_traits<It>::value_type,
class Result class Result = typename decltype(
= typename decltype(std::declval<ItT>().then(std::declval<F>()))::value_type> std::declval<ItT>().then(std::declval<F>()))::value_type>
std::vector<Future<Result>> map(It first, It last, F func); std::vector<Future<Result>> map(It first, It last, F func);
// Sugar for the most common case // Sugar for the most common case
...@@ -363,7 +365,10 @@ auto reduce(Collection&& c, T&& initial, F&& func) ...@@ -363,7 +365,10 @@ 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 <class It, class T, class F, template <
class It,
class T,
class F,
class ItT = typename std::iterator_traits<It>::value_type::value_type, class ItT = typename std::iterator_traits<It>::value_type::value_type,
class Arg = MaybeTryArg<F, T, ItT>> 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);
......
...@@ -89,7 +89,8 @@ pair<KeyT,ValueT> createEntry(int i) { ...@@ -89,7 +89,8 @@ pair<KeyT,ValueT> createEntry(int i) {
to<ValueT>(i + 3)); to<ValueT>(i + 3));
} }
template <class KeyT, template <
class KeyT,
class ValueT, class ValueT,
class Allocator = std::allocator<char>, class Allocator = std::allocator<char>,
class ProbeFcn = AtomicHashArrayLinearProbeFcn> class ProbeFcn = AtomicHashArrayLinearProbeFcn>
......
...@@ -88,7 +88,8 @@ struct non_atomic { ...@@ -88,7 +88,8 @@ struct non_atomic {
bool is_lock_free() const {return true;} bool is_lock_free() const {return true;}
}; };
template <typename Key, template <
typename Key,
typename Value, typename Value,
typename IndexType, typename IndexType,
template <typename> class Atom = std::atomic, template <typename> class Atom = std::atomic,
......
...@@ -381,7 +381,8 @@ struct WriteCaller : public WriteMethodCaller<Q> { ...@@ -381,7 +381,8 @@ struct WriteCaller : public WriteMethodCaller<Q> {
string methodName() override { return "write"; } string methodName() override { return "write"; }
}; };
template <typename Q, template <
typename Q,
class Clock = steady_clock, class Clock = steady_clock,
class Duration = typename Clock::duration> class Duration = typename Clock::duration>
struct TryWriteUntilCaller : public WriteMethodCaller<Q> { struct TryWriteUntilCaller : public WriteMethodCaller<Q> {
......
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