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,
* 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
* 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,
* 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) {
}
}
-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,
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) {
}
// 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() {
// 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>::
*
* 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);
}
- 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);
* 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,
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>
}
// 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,
}
// 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
}
// 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>::
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
}
// 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>::
}
// 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
}
// 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
}
// 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 {
// 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 {
// 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() {
}
// 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 {
// 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>::
// 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>::
* 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);
/*
*
* 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);
- 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;
/*
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);
- 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;
}; // 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,
/// 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,
#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(
}
/// 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,
* 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());
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;
// 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;
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);
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)
/// (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,
- 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) {
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,
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) {
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,
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,
* 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:
* 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:
// 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,
}
};
-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);
}
// 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;
* 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
/** 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
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;
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,
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) {}