38 #if !FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 42 #include <unordered_set> 48 template <
typename K,
typename H,
typename E,
typename A>
50 using Super = std::unordered_set<K, H, E, A>;
53 using typename Super::pointer;
54 using typename Super::value_type;
66 [&](std::size_t bytes, std::size_t n) { rv += bytes * n; });
73 auto bc = this->bucket_count();
75 visitor(bc *
sizeof(pointer), 1);
77 if (this->
size() > 0) {
84 for (value_type
const& entry : *
this) {
85 value_type
const*
b = std::addressof(entry);
93 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
99 using typename Super::value_type;
106 Super::operator=(ilist);
111 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
117 using typename Super::value_type;
124 Super::operator=(ilist);
129 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
135 using typename Super::value_type;
142 Super::operator=(ilist);
149 #else // FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 157 template <
typename Policy>
159 template <
typename K,
typename T>
160 using EnableHeterogeneousFind = std::enable_if_t<
161 EligibleForHeterogeneousFind<
163 typename Policy::Hasher,
164 typename Policy::KeyEqual,
168 template <
typename K,
typename T>
169 using EnableHeterogeneousInsert = std::enable_if_t<
170 EligibleForHeterogeneousInsert<
172 typename Policy::Hasher,
173 typename Policy::KeyEqual,
177 template <
typename K,
typename T>
178 using EnableHeterogeneousErase = std::enable_if_t<
179 EligibleForHeterogeneousFind<
181 typename Policy::Hasher,
182 typename Policy::KeyEqual,
184 !std::is_same<typename Policy::Iter, remove_cvref_t<K>>
::value,
191 using value_type = key_type;
192 using size_type = std::size_t;
193 using difference_type = std::ptrdiff_t;
194 using hasher =
typename Policy::Hasher;
195 using key_equal =
typename Policy::KeyEqual;
196 using allocator_type =
typename Policy::Alloc;
197 using reference = value_type&;
198 using const_reference = value_type
const&;
199 using pointer =
typename Policy::AllocTraits::pointer;
200 using const_pointer =
typename Policy::AllocTraits::const_pointer;
202 using const_iterator = iterator;
205 using ItemIter =
typename Policy::ItemIter;
214 std::size_t initialCapacity,
216 key_equal
const&
eq = key_equal{},
217 allocator_type
const& alloc = allocator_type{})
218 : table_{initialCapacity, hash, eq, alloc} {}
220 explicit F14BasicSet(std::size_t initialCapacity, allocator_type
const& alloc)
224 std::size_t initialCapacity,
226 allocator_type
const& alloc)
227 :
F14BasicSet(initialCapacity, hash, key_equal{}, alloc) {}
232 template <
typename InputIt>
236 std::size_t initialCapacity = 0,
238 key_equal
const& eq = key_equal{},
239 allocator_type
const& alloc = allocator_type{})
240 : table_{initialCapacity, hash, eq, alloc} {
241 initialInsert(first, last, initialCapacity);
244 template <
typename InputIt>
248 std::size_t initialCapacity,
249 allocator_type
const& alloc)
250 : table_{initialCapacity,
hasher{}, key_equal{}, alloc} {
251 initialInsert(first, last, initialCapacity);
254 template <
typename InputIt>
258 std::size_t initialCapacity,
260 allocator_type
const& alloc)
261 : table_{initialCapacity, hash, key_equal{}, alloc} {
262 initialInsert(first, last, initialCapacity);
268 : table_(rhs.table_, alloc) {}
273 Policy::kAllocIsAlwaysEqual)
274 : table_{
std::move(rhs.table_), alloc} {}
277 std::initializer_list<value_type>
init,
278 std::size_t initialCapacity = 0,
280 key_equal
const& eq = key_equal{},
281 allocator_type
const& alloc = allocator_type{})
282 : table_{initialCapacity, hash, eq, alloc} {
283 initialInsert(init.begin(), init.end(), initialCapacity);
287 std::initializer_list<value_type> init,
288 std::size_t initialCapacity,
289 allocator_type
const& alloc)
290 : table_{initialCapacity,
hasher{}, key_equal{}, alloc} {
291 initialInsert(init.begin(), init.end(), initialCapacity);
295 std::initializer_list<value_type> init,
296 std::size_t initialCapacity,
298 allocator_type
const& alloc)
299 : table_{initialCapacity, hash, key_equal{}, alloc} {
300 initialInsert(init.begin(), init.end(), initialCapacity);
303 F14BasicSet& operator=(F14BasicSet
const&) =
default;
305 F14BasicSet& operator=(F14BasicSet&&) =
default;
307 F14BasicSet& operator=(std::initializer_list<value_type> ilist) {
309 bulkInsert(ilist.begin(), ilist.end(),
false);
313 allocator_type get_allocator()
const noexcept {
314 return table_.alloc();
326 return table_.makeIter(table_.begin());
336 return table_.makeIter(table_.end());
342 return table_.empty();
346 return table_.size();
349 std::size_t max_size()
const noexcept {
350 return table_.max_size();
359 std::pair<iterator, bool> insert(value_type
const&
value) {
360 return emplace(value);
363 std::pair<iterator, bool> insert(value_type&& value) {
372 iterator insert(const_iterator , value_type
const& value) {
373 return insert(value).first;
376 iterator insert(const_iterator , value_type&& value) {
380 template <
typename K>
381 EnableHeterogeneousInsert<K, std::pair<iterator, bool>> insert(K&& value) {
382 return emplace(std::forward<K>(value));
386 template <
class InputIt>
388 bulkInsert(InputIt first, InputIt last,
bool autoReserve) {
390 table_.reserveForInsert(std::distance(first, last));
392 while (first != last) {
398 template <
class InputIt>
399 void initialInsert(InputIt first, InputIt last, std::size_t initialCapacity) {
409 typename std::iterator_traits<InputIt>::iterator_category,
410 std::random_access_iterator_tag>::value &&
411 initialCapacity == 0;
412 bulkInsert(first, last, autoReserve);
416 template <
class InputIt>
417 void insert(InputIt first, InputIt last) {
423 typename std::iterator_traits<InputIt>::iterator_category,
424 std::random_access_iterator_tag>::value &&
426 bulkInsert(first, last, autoReserve);
429 void insert(std::initializer_list<value_type> ilist) {
430 insert(ilist.begin(), ilist.end());
433 template <
class...
Args>
434 std::pair<iterator, bool> emplace(
Args&&... args) {
435 using K = KeyTypeForEmplace<key_type,
hasher, key_equal,
Args...>;
441 K key(std::forward<Args>(args)...);
443 auto rv = table_.tryEmplaceValue(key, std::forward<K>(key));
445 return std::make_pair(table_.makeIter(rv.first), rv.second);
448 template <
class...
Args>
449 iterator emplace_hint(const_iterator ,
Args&&... args) {
450 return emplace(std::forward<Args>(args)...).first;
454 return eraseInto(pos, [](value_type&&) {});
457 iterator erase(const_iterator first, const_iterator last) {
458 return eraseInto(first, last, [](value_type&&) {});
461 size_type erase(key_type
const& key) {
462 return eraseInto(key, [](value_type&&) {});
465 template <
typename K>
466 EnableHeterogeneousErase<K, size_type> erase(K
const& key) {
467 return eraseInto(key, [](value_type&&) {});
474 template <
typename BeforeDestroy>
476 eraseInto(const_iterator pos, BeforeDestroy&& beforeDestroy) {
477 auto itemPos = table_.unwrapIter(pos);
478 table_.eraseIterInto(itemPos, beforeDestroy);
482 itemPos.advanceLikelyDead();
483 return table_.makeIter(itemPos);
486 template <
typename BeforeDestroy>
488 const_iterator first,
490 BeforeDestroy&& beforeDestroy) {
491 while (first != last) {
492 first = eraseInto(first, beforeDestroy);
497 template <
typename BeforeDestroy>
498 size_type eraseInto(key_type
const& key, BeforeDestroy&& beforeDestroy) {
499 return table_.eraseKeyInto(key, beforeDestroy);
502 template <
typename K,
typename BeforeDestroy>
503 EnableHeterogeneousErase<K, size_type> eraseInto(
505 BeforeDestroy&& beforeDestroy) {
506 return table_.eraseKeyInto(key, beforeDestroy);
512 return table_.find(key).atEnd() ? 0 : 1;
515 template <
typename K>
517 K
const& key)
const {
518 return table_.find(key).atEnd() ? 0 : 1;
535 F14HashToken prehash(key_type
const& key)
const {
536 return table_.prehash(key);
539 template <
typename K>
540 EnableHeterogeneousFind<K, F14HashToken> prehash(K
const& key)
const {
541 return table_.prehash(key);
545 return const_cast<F14BasicSet
const*
>(
this)->find(key);
549 return table_.makeIter(table_.find(key));
553 find(F14HashToken
const& token, key_type
const& key) {
554 return const_cast<F14BasicSet
const*
>(
this)->find(token, key);
558 find(F14HashToken
const& token, key_type
const& key)
const {
559 return table_.makeIter(table_.find(token, key));
562 template <
typename K>
564 return const_cast<F14BasicSet
const*
>(
this)->find(key);
567 template <
typename K>
569 K
const& key)
const {
570 return table_.makeIter(table_.find(key));
573 template <
typename K>
575 F14HashToken
const& token,
577 return const_cast<F14BasicSet
const*
>(
this)->find(token, key);
580 template <
typename K>
582 F14HashToken
const& token,
583 K
const& key)
const {
584 return table_.makeIter(table_.find(token, key));
587 std::pair<iterator, iterator> equal_range(key_type
const& key) {
588 return equal_range(*
this, key);
591 std::pair<const_iterator, const_iterator> equal_range(
592 key_type
const& key)
const {
593 return equal_range(*
this, key);
596 template <
typename K>
597 EnableHeterogeneousFind<K, std::pair<iterator, iterator>> equal_range(
599 return equal_range(*
this, key);
602 template <
typename K>
603 EnableHeterogeneousFind<K, std::pair<const_iterator, const_iterator>>
604 equal_range(K
const& key)
const {
605 return equal_range(*
this, key);
610 std::size_t bucket_count()
const noexcept {
611 return table_.bucket_count();
614 std::size_t max_bucket_count()
const noexcept {
615 return table_.max_bucket_count();
620 float load_factor()
const noexcept {
621 return table_.load_factor();
624 float max_load_factor()
const noexcept {
625 return table_.max_load_factor();
628 void max_load_factor(
float v) {
629 table_.max_load_factor(v);
632 void rehash(std::size_t bucketCapacity) {
639 void reserve(std::size_t capacity) {
640 table_.reserve(capacity);
645 hasher hash_function()
const {
646 return table_.hasher();
649 key_equal key_eq()
const {
650 return table_.keyEqual();
657 return table_.getAllocatedMemorySize();
669 template <
typename V>
671 return table_.visitAllocationClasses(visitor);
678 template <
typename V>
682 return table_.computeStats();
686 template <
typename Self,
typename K>
687 static auto equal_range(Self&
self, K
const& key) {
688 auto first =
self.find(key);
690 if (last !=
self.
end()) {
693 return std::make_pair(first, last);
697 F14Table<Policy> table_;
700 template <
typename S>
701 bool setsEqual(S
const& lhs, S
const&
rhs) {
702 if (lhs.size() != rhs.size()) {
705 for (
auto&
k : lhs) {
706 auto iter = rhs.find(
k);
707 if (iter == rhs.end()) {
711 typename S::key_equal,
712 std::equal_to<typename S::value_type>>::
value) {
724 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
727 f14::detail::ValueContainerPolicy,
732 using Policy = f14::detail::SetPolicyWithDefaults<
733 f14::detail::ValueContainerPolicy,
741 using typename Super::value_type;
747 F14ValueSet& operator=(std::initializer_list<value_type> ilist) {
748 Super::operator=(ilist);
753 this->table_.swap(rhs.table_);
756 template <
typename V>
758 this->table_.visitContiguousItemRanges(std::forward<V>(visitor));
762 template <
typename K,
typename H,
typename E,
typename A>
766 return setsEqual(lhs, rhs);
769 template <
typename K,
typename H,
typename E,
typename A>
773 return !(lhs ==
rhs);
776 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
779 f14::detail::NodeContainerPolicy,
784 using Policy = f14::detail::SetPolicyWithDefaults<
785 f14::detail::NodeContainerPolicy,
793 using typename Super::value_type;
799 F14NodeSet& operator=(std::initializer_list<value_type> ilist) {
800 Super::operator=(ilist);
805 this->table_.swap(rhs.table_);
808 template <
typename V>
810 this->table_.visitItems([&](
typename Policy::Item
ptr) {
811 value_type
const*
b = std::addressof(*ptr);
817 template <
typename K,
typename H,
typename E,
typename A>
821 return setsEqual(lhs, rhs);
824 template <
typename K,
typename H,
typename E,
typename A>
828 return !(lhs ==
rhs);
831 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
834 f14::detail::VectorContainerPolicy,
839 using Policy = f14::detail::SetPolicyWithDefaults<
840 f14::detail::VectorContainerPolicy,
847 template <
typename K,
typename T>
848 using EnableHeterogeneousVectorErase = std::enable_if_t<
849 f14::detail::EligibleForHeterogeneousFind<
851 typename Policy::Hasher,
852 typename Policy::KeyEqual,
854 !std::is_same<typename Policy::Iter, remove_cvref_t<K>>
::value &&
855 !std::is_same<typename Policy::ReverseIter, remove_cvref_t<K>>
::value,
859 using typename Super::const_iterator;
860 using typename Super::iterator;
861 using typename Super::key_type;
862 using typename Super::value_type;
863 using reverse_iterator =
typename Policy::ReverseIter;
864 using const_reverse_iterator = reverse_iterator;
870 F14VectorSet& operator=(std::initializer_list<value_type> ilist) {
871 Super::operator=(ilist);
876 this->table_.swap(rhs.table_);
903 const_iterator
begin()
const {
906 const_iterator
cbegin()
const {
907 return this->table_.linearBegin(this->
size());
913 const_iterator
end()
const {
916 const_iterator
cend()
const {
917 return this->table_.linearEnd();
920 reverse_iterator rbegin() {
921 return this->table_.values_;
923 const_reverse_iterator rbegin()
const {
926 const_reverse_iterator crbegin()
const {
927 return this->table_.values_;
930 reverse_iterator rend() {
931 return this->table_.values_ + this->table_.size();
933 const_reverse_iterator rend()
const {
936 const_reverse_iterator crend()
const {
937 return this->table_.values_ + this->table_.size();
941 iterator iter(reverse_iterator riter) {
942 return this->table_.iter(riter);
944 const_iterator iter(const_reverse_iterator riter)
const {
945 return this->table_.iter(riter);
948 reverse_iterator riter(iterator it) {
949 return this->table_.riter(it);
951 const_reverse_iterator riter(const_iterator it)
const {
952 return this->table_.riter(it);
956 template <
typename BeforeDestroy>
957 void eraseUnderlying(
958 typename Policy::ItemIter underlying,
959 BeforeDestroy&& beforeDestroy) {
960 Alloc&
a = this->table_.alloc();
961 auto values = this->table_.values_;
964 auto index = underlying.item();
965 this->table_.eraseIterInto(underlying, beforeDestroy);
969 auto tailIndex = this->
size();
970 if (tailIndex != index) {
971 auto tail = this->table_.find(f14::detail::VectorContainerIndexSearch{
974 auto p = std::addressof(
values[index]);
976 this->table_.transfer(a, std::addressof(
values[tailIndex]), p, 1);
980 template <
typename K,
typename BeforeDestroy>
981 std::size_t eraseUnderlyingKey(K
const& key, BeforeDestroy&& beforeDestroy) {
982 auto underlying = this->table_.find(key);
983 if (underlying.atEnd()) {
986 eraseUnderlying(underlying, beforeDestroy);
993 return eraseInto(pos, [](value_type&&) {});
996 iterator erase(const_iterator
first, const_iterator last) {
997 return eraseInto(first, last, [](value_type&&) {});
1004 std::size_t erase(key_type
const& key) {
1005 return eraseInto(key, [](value_type&&) {});
1008 template <
typename K>
1009 EnableHeterogeneousVectorErase<K, std::size_t> erase(K
const& key) {
1010 return eraseInto(key, [](value_type&&) {});
1013 template <
typename BeforeDestroy>
1015 eraseInto(const_iterator pos, BeforeDestroy&& beforeDestroy) {
1016 auto underlying = this->table_.find(
1017 f14::detail::VectorContainerIndexSearch{this->table_.iterToIndex(pos)});
1018 eraseUnderlying(underlying, beforeDestroy);
1022 template <
typename BeforeDestroy>
1024 const_iterator first,
1025 const_iterator last,
1026 BeforeDestroy&& beforeDestroy) {
1027 while (first != last) {
1028 first = eraseInto(first, beforeDestroy);
1033 template <
typename BeforeDestroy>
1034 std::size_t eraseInto(key_type
const& key, BeforeDestroy&& beforeDestroy) {
1035 return eraseUnderlyingKey(key, beforeDestroy);
1038 template <
typename K,
typename BeforeDestroy>
1039 EnableHeterogeneousVectorErase<K, std::size_t> eraseInto(
1041 BeforeDestroy&& beforeDestroy) {
1042 return eraseUnderlyingKey(key, beforeDestroy);
1045 template <
typename V>
1047 auto n = this->table_.size();
1049 value_type
const*
b = std::addressof(this->table_.values_[0]);
1055 template <
typename K,
typename H,
typename E,
typename A>
1059 return setsEqual(lhs, rhs);
1062 template <
typename K,
typename H,
typename E,
typename A>
1066 return !(lhs ==
rhs);
1070 #endif // FOLLY_F14_VECTOR_INTRINSICS_AVAILABLE 1073 template <
typename Key,
typename Hasher,
typename KeyEqual,
typename Alloc>
1074 class F14FastSet :
public std::conditional_t<
1076 F14ValueSet<Key, Hasher, KeyEqual, Alloc>,
1077 F14VectorSet<Key, Hasher, KeyEqual, Alloc>> {
1078 using Super = std::conditional_t<
1080 F14ValueSet<Key, Hasher, KeyEqual, Alloc>,
1081 F14VectorSet<Key, Hasher, KeyEqual, Alloc>>;
1084 using typename Super::value_type;
1086 F14FastSet() = default;
1090 F14FastSet& operator=(std::initializer_list<value_type> ilist) {
1091 Super::operator=(ilist);
1096 template <typename K, typename H, typename E, typename A>
1097 void swap(F14ValueSet<K, H, E, A>& lhs, F14ValueSet<K, H, E, A>& rhs) noexcept(
1098 noexcept(lhs.swap(rhs))) {
1102 template <typename K, typename H, typename E, typename A>
1103 void swap(F14NodeSet<K, H, E, A>& lhs, F14NodeSet<K, H, E, A>& rhs) noexcept(
1104 noexcept(lhs.swap(rhs))) {
1108 template <typename K, typename H, typename E, typename A>
1110 F14VectorSet<K, H, E, A>& lhs,
1111 F14VectorSet<K, H, E, A>& rhs) noexcept(noexcept(lhs.swap(rhs))) {
1115 template <typename K, typename H, typename E, typename A>
1116 void swap(F14FastSet<K, H, E, A>& lhs, F14FastSet<K, H, E, A>& rhs) noexcept(
1117 noexcept(lhs.swap(rhs))) {
std::unordered_set< Key, Hasher, KeyEqual, Alloc > Super
F14VectorSet & operator=(std::initializer_list< value_type > ilist)
#define FOLLY_ALWAYS_INLINE
std::size_t getAllocatedMemorySize() const
bool operator!=(SwapTrackingAlloc< T1 > const &, SwapTrackingAlloc< T2 > const &)
constexpr detail::Map< Move > move
F14NodeSet & operator=(std::initializer_list< value_type > ilist)
internal::KeyMatcher< M > Key(M inner_matcher)
auto begin(TestAdlIterable &instance)
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
FOLLY_PUSH_WARNING RHS rhs
void visitContiguousRanges(V &&visitor) const
void init(int *argc, char ***argv, bool removeFlags)
constexpr auto size(C const &c) -> decltype(c.size())
constexpr auto empty(C const &c) -> decltype(c.empty())
def Iter(n, format, sep='')
bool Value(const T &value, M matcher)
auto end(TestAdlIterable &instance)
std::enable_if< std::is_integral< Src >::value &&IsSomeString< Tgt >::value &&sizeof(Src)< 4 >::typetoAppend(Src value, Tgt *result){typedef typename std::conditional< std::is_signed< Src >::value, int64_t, uint64_t >::type Intermediate;toAppend< Tgt >static_cast< Intermediate >value), result);}template< class Src >typename std::enable_if< std::is_integral< Src >::value &&sizeof(Src)< 4 &&!std::is_same< Src, char >::value, size_t >::typeestimateSpaceNeeded(Src value){typedef typename std::conditional< std::is_signed< Src >::value, int64_t, uint64_t >::type Intermediate;return estimateSpaceNeeded(static_cast< Intermediate >value));}template< class Tgt, class Src >typename std::enable_if< std::is_enum< Src >::value &&IsSomeString< Tgt >::value >::typetoAppend(Src value, Tgt *result){toAppend(static_cast< typename std::underlying_type< Src >::type >value), result);}template< class Src >typename std::enable_if< std::is_enum< Src >::value, size_t >::typeestimateSpaceNeeded(Src value){return estimateSpaceNeeded(static_cast< typename std::underlying_type< Src >::type >value));}namespace detail{constexpr int kConvMaxDecimalInShortestLow=-6;constexpr int kConvMaxDecimalInShortestHigh=21;}template< class Tgt, class Src >typename std::enable_if< std::is_floating_point< Src >::value &&IsSomeString< Tgt >::value >::typetoAppend(Src value, Tgt *result, double_conversion::DoubleToStringConverter::DtoaMode mode, unsigned int numDigits){using namespace double_conversion;DoubleToStringConverter conv(DoubleToStringConverter::NO_FLAGS,"Infinity","NaN", 'E', detail::kConvMaxDecimalInShortestLow, detail::kConvMaxDecimalInShortestHigh, 6, 1);char buffer[256];StringBuilder builder(buffer, sizeof(buffer));switch(mode){case DoubleToStringConverter::SHORTEST:conv.ToShortest(value,&builder);break;case DoubleToStringConverter::SHORTEST_SINGLE:conv.ToShortestSingle(static_cast< float >value),&builder);break;case DoubleToStringConverter::FIXED:conv.ToFixed(value, int(numDigits),&builder);break;default:CHECK(mode==DoubleToStringConverter::PRECISION);conv.ToPrecision(value, int(numDigits),&builder);break;}const size_t length=size_t(builder.position());builder.Finalize();result->append(buffer, length);}template< class Tgt, class Src >typename std::enable_if< std::is_floating_point< Src >::value &&IsSomeString< Tgt >::value >::typetoAppend(Src value, Tgt *result){toAppend(value, result, double_conversion::DoubleToStringConverter::SHORTEST, 0);}template< class Src >typename std::enable_if< std::is_floating_point< Src >::value, size_t >::typeestimateSpaceNeeded(Src value){constexpr int kMaxMantissaSpace=double_conversion::DoubleToStringConverter::kBase10MaximalLength+1;constexpr int kMaxExponentSpace=2+3;static const int kMaxPositiveSpace=std::max({kMaxMantissaSpace+kMaxExponentSpace, kMaxMantissaSpace-detail::kConvMaxDecimalInShortestLow, detail::kConvMaxDecimalInShortestHigh,});return size_t(kMaxPositiveSpace+(value< 0?1:0));}template< class Src >struct HasLengthEstimator:std::false_type{};template< class Src >constexpr typename std::enable_if< !std::is_fundamental< Src >::value &&!IsSomeString< Src >::value &&!std::is_convertible< Src, const char * >::value &&!std::is_convertible< Src, StringPiece >::value &&!std::is_enum< Src >::value &&!HasLengthEstimator< Src >::value, size_t >::typeestimateSpaceNeeded(const Src &){return sizeof(Src)+1;}namespace detail{template< class Tgt >typename std::enable_if< IsSomeString< Tgt >::value, size_t >::typeestimateSpaceToReserve(size_t sofar, Tgt *){return sofar;}template< class T, class...Ts >size_t estimateSpaceToReserve(size_t sofar, const T &v, const Ts &...vs){return estimateSpaceToReserve(sofar+estimateSpaceNeeded(v), vs...);}template< class...Ts >void reserveInTarget(const Ts &...vs){getLastElement(vs...) -> reserve(estimateSpaceToReserve(0, vs...))
F14ValueSet & operator=(std::initializer_list< value_type > ilist)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
FOLLY_ALWAYS_INLINE void assume(bool cond)
void visitAllocationClasses(V &&visitor) const
#define FOLLY_SAFE_DCHECK(expr, msg)
Iterator< typename Container::const_iterator > cbegin(const Container &c)
Iterator< typename Container::const_iterator > cend(const Container &c)
std::vector< int > values(1'000)
constexpr detail::First first
bool operator==(SwapTrackingAlloc< T1 > const &, SwapTrackingAlloc< T2 > const &)