1#if !defined(phmap_base_h_guard_)
2#define phmap_base_h_guard_
40#include <initializer_list>
53#ifdef PHMAP_HAVE_SHARED_MUTEX
54 #include <shared_mutex>
59 #pragma warning(disable : 4514)
60 #pragma warning(disable : 4582)
61 #pragma warning(disable : 4625)
62 #pragma warning(disable : 4626)
63 #pragma warning(disable : 4710)
64 #pragma warning(disable : 4711)
65 #pragma warning(disable : 4820)
70template <
class T>
using Allocator =
typename std::allocator<T>;
72template<
class T1,
class T2>
using Pair =
typename std::pair<T1, T2>;
79 return std::equal_to<T>()(a, b);
88 return std::less<T>()(a, b);
92namespace type_traits_internal {
94template <
typename... Ts>
103template <
size_t Len,
typename T = std::aligned_storage<Len>>
106template <
size_t Len,
size_t Align>
108 std::aligned_storage<Len, Align>> {
109 static constexpr size_t value = Align;
123template <
class Enabler,
template <
class...>
class Op,
class... Args>
128template <
template <
class...>
class Op,
class... Args>
133template <
template <
class...>
class Op,
class... Args>
136template <
class Enabler,
class To,
template <
class...>
class Op,
class... Args>
141template <
class To,
template <
class...>
class Op,
class... Args>
143 typename
std::enable_if<std::is_convertible<Op<Args...>, To>::value>::type,
148template <
class To,
template <
class...>
class Op,
class... Args>
154 decltype(std::declval<T&>() = std::declval<const T&>());
163 type_traits_internal::IsCopyAssignableImpl, T> {
168 type_traits_internal::IsMoveAssignableImpl, T> {
185template <
typename... Ts>
199template <
typename... Ts>
202template <
typename T,
typename... Ts>
204 : std::conditional<T::value, conjunction<Ts...>, T>::type {};
223template <
typename... Ts>
226template <
typename T,
typename... Ts>
228 std::conditional<T::value, T, disjunction<Ts...>>::type {};
237struct negation : std::integral_constant<bool, !T::value> {};
241 : std::integral_constant<bool, __has_trivial_destructor(T) &&
242 std::is_destructible<T>::value> {};
246 : std::integral_constant<bool, __has_trivial_constructor(T) &&
247 std::is_default_constructible<T>::value &&
248 is_trivially_destructible<T>::value> {};
252 : std::integral_constant<bool, __has_trivial_copy(T) &&
253 std::is_copy_constructible<T>::value &&
254 is_trivially_destructible<T>::value> {};
258 : std::integral_constant<
259 bool, __has_trivial_assign(typename std::remove_reference<T>::type) &&
260 phmap::is_copy_assignable<T>::value> {};
311template <
size_t Len,
size_t Align = type_traits_internal::
312 default_alignment_of_aligned_storage<Len>::value>
318template <
bool B,
typename T =
void>
321template <
bool B,
typename T,
typename F>
325template <
typename... T>
331template<
class F,
class... ArgTypes>
332#if PHMAP_HAVE_CC17 && defined(__cpp_lib_result_of_sfinae)
338namespace type_traits_internal {
345#if defined(_MSC_VER) || (defined(_LIBCPP_VERSION) && \
346 _LIBCPP_VERSION < 4000 && _LIBCPP_STD_VER > 11)
347 #define PHMAP_META_INTERNAL_STD_HASH_SFINAE_FRIENDLY_ 0
349 #define PHMAP_META_INTERNAL_STD_HASH_SFINAE_FRIENDLY_ 1
352#if !PHMAP_META_INTERNAL_STD_HASH_SFINAE_FRIENDLY_
353 template <
typename Key,
typename =
size_t>
354 struct IsHashable : std::true_type {};
356 template <
typename Key,
typename =
void>
359 template <
typename Key>
362 decltype(std::declval<std::hash<Key>&>()(std::declval<Key const&>())),
363 std::size_t>::value>> : std::true_type {};
374 ->
decltype(std::declval<std::hash<Key>>()(std::declval<Key const&>()));
381 "std::hash<Key> does not provide a call operator");
383 std::is_default_constructible<std::hash<Key>>::value,
384 "std::hash<Key> must be default constructible when it is enabled");
386 std::is_copy_constructible<std::hash<Key>>::value,
387 "std::hash<Key> must be copy constructible when it is enabled");
389 "std::hash<Key> must be copy assignable when it is enabled");
392 using ReturnType =
decltype(GetReturnType<Key>(0));
393 static_assert(std::is_same<ReturnType, NAT>::value ||
394 std::is_same<ReturnType, size_t>::value,
395 "std::hash<Key> must return size_t");
399 template <
class... Ts>
403template <
class... Ts>
408 Helper::Sink(Helper::DoIt<Ts>()...);
423template <
class Policy,
class =
void>
433 template <
class Key,
class... Args>
435 return std::forward<Key>(k);
439 template <
class P = Policy,
class =
void>
444 : P::constant_iterators {};
458 using reference =
decltype(Policy::element(std::declval<slot_type*>()));
459 using pointer =
typename std::remove_reference<reference>::type*;
460 using value_type =
typename std::remove_reference<reference>::type;
470 template <
class Alloc,
class... Args>
472 Policy::construct(alloc, slot, std::forward<Args>(args)...);
477 template <
class Alloc>
479 Policy::destroy(alloc, slot);
493 template <
class Alloc>
500 template <
class P = Policy>
502 return P::element(slot);
511 template <
class P = Policy>
513 return P::space_used(slot);
545 template <
class F,
class... Ts,
class P = Policy>
546 static auto apply(F&& f, Ts&&... ts)
547 ->
decltype(P::apply(std::forward<F>(f), std::forward<Ts>(ts)...)) {
548 return P::apply(std::forward<F>(f), std::forward<Ts>(ts)...);
553 template <
class P = Policy>
561 template <
class T,
class P = Policy>
562 static auto value(T* elem) ->
decltype(P::value(elem)) {
563 return P::value(elem);
569 template <
class Alloc,
class P = Policy>
572 ->
decltype((void)P::transfer(alloc, new_slot, old_slot)) {
573 P::transfer(alloc, new_slot, old_slot);
576 template <
class Alloc>
609#ifdef __cpp_inline_variables
611#if defined(__clang__)
612 #define PHMAP_INTERNAL_EXTERN_DECL(type, name) \
613 extern const ::phmap::internal::identity_t<type> name;
615 #define PHMAP_INTERNAL_EXTERN_DECL(type, name)
619#define PHMAP_INTERNAL_INLINE_CONSTEXPR(type, name, init) \
620 PHMAP_INTERNAL_EXTERN_DECL(type, name) \
621 inline constexpr ::phmap::internal::identity_t<type> name = init
631#define PHMAP_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \
632 template <class = void> \
633 struct PhmapInternalInlineVariableHolder##name { \
634 static constexpr ::phmap::internal::identity_t<var_type> kInstance = init; \
637 template <class PhmapInternalDummy> \
638 constexpr ::phmap::internal::identity_t<var_type> \
639 PhmapInternalInlineVariableHolder##name<PhmapInternalDummy>::kInstance; \
641 static constexpr const ::phmap::internal::identity_t<var_type>& \
643 PhmapInternalInlineVariableHolder##name<>::kInstance; \
644 static_assert(sizeof(void (*)(decltype(name))) != 0, \
645 "Silence unused variable warnings.")
652namespace base_internal {
656#ifdef PHMAP_HAVE_EXCEPTIONS
657[[noreturn]]
void Throw(
const T& error) {
661[[noreturn]]
void Throw(
const T&) {
668 Throw(std::logic_error(what_arg));
671 Throw(std::logic_error(what_arg));
674 Throw(std::invalid_argument(what_arg));
677 Throw(std::invalid_argument(what_arg));
681 Throw(std::domain_error(what_arg));
684 Throw(std::domain_error(what_arg));
688 Throw(std::length_error(what_arg));
691 Throw(std::length_error(what_arg));
695 Throw(std::out_of_range(what_arg));
698 Throw(std::out_of_range(what_arg));
702 Throw(std::runtime_error(what_arg));
705 Throw(std::runtime_error(what_arg));
709 Throw(std::range_error(what_arg));
712 Throw(std::range_error(what_arg));
716 Throw(std::overflow_error(what_arg));
719 Throw(std::overflow_error(what_arg));
723 Throw(std::underflow_error(what_arg));
726 Throw(std::underflow_error(what_arg));
739namespace base_internal {
741template <
typename Derived>
744 template <
typename... Args>
745 struct Accept : Derived::template AcceptImpl<typename std::remove_cv<
746 typename std::remove_reference<Args>::type>::type...> {};
754 template <
typename... Args>
757 template <
typename R,
typename C,
typename... Params,
typename Obj,
760 : std::is_base_of<C, Obj> {};
762 template <
typename R,
typename C,
typename... Params,
typename Obj,
765 : std::is_base_of<C, Obj> {};
767 template <
typename MemFun,
typename Obj,
typename... Args>
768 static decltype((std::declval<Obj>().*
769 std::declval<MemFun>())(std::declval<Args>()...))
770 Invoke(MemFun&& mem_fun, Obj&& obj, Args&&... args) {
771 return (std::forward<Obj>(obj).*
772 std::forward<MemFun>(mem_fun))(std::forward<Args>(args)...);
780 template <
typename... Args>
783 template <
typename R,
typename C,
typename... Params,
typename Ptr,
786 : std::integral_constant<bool, !std::is_base_of<C, Ptr>::value> {};
788 template <
typename R,
typename C,
typename... Params,
typename Ptr,
791 : std::integral_constant<bool, !std::is_base_of<C, Ptr>::value> {};
793 template <
typename MemFun,
typename Ptr,
typename... Args>
794 static decltype(((*std::declval<Ptr>()).*
795 std::declval<MemFun>())(std::declval<Args>()...))
796 Invoke(MemFun&& mem_fun, Ptr&& ptr, Args&&... args) {
797 return ((*std::forward<Ptr>(ptr)).*
798 std::forward<MemFun>(mem_fun))(std::forward<Args>(args)...);
807 template <
typename... Args>
810 template <
typename R,
typename C,
typename Obj>
813 template <
typename DataMem,
typename Ref>
814 static decltype(std::declval<Ref>().*std::declval<DataMem>())
Invoke(
815 DataMem&& data_mem, Ref&& ref) {
816 return std::forward<Ref>(ref).*std::forward<DataMem>(data_mem);
824 template <
typename... Args>
827 template <
typename R,
typename C,
typename Ptr>
829 : std::integral_constant<bool, !std::is_base_of<C, Ptr>::value> {};
831 template <
typename DataMem,
typename Ptr>
832 static decltype((*std::declval<Ptr>()).*std::declval<DataMem>())
Invoke(
833 DataMem&& data_mem, Ptr&& ptr) {
834 return (*std::forward<Ptr>(ptr)).*std::forward<DataMem>(data_mem);
843 template <
typename F,
typename... Args>
844 static decltype(std::declval<F>()(std::declval<Args>()...))
Invoke(
845 F&& f, Args&&... args) {
846 return std::forward<F>(f)(std::forward<Args>(args)...);
851template <
typename... Args>
854 typedef typename std::conditional<
856 typename std::conditional<
858 typename std::conditional<
860 typename std::conditional<DataMemAndPtr::Accept<Args...>::value,
866template <
typename F,
typename... Args>
868 std::declval<F>(), std::declval<Args>()...));
872template <
typename F,
typename... Args>
875 std::forward<Args>(args)...);
904template <
typename T, T... Ints>
908 static constexpr size_t size() noexcept {
return sizeof...(Ints); }
916template <
size_t... Ints>
919namespace utility_internal {
921template <
typename Seq,
size_t SeqSize,
size_t Rem>
925template <
typename T, T... Ints,
size_t SeqSize>
930template <
typename T, T... Ints,
size_t SeqSize>
937template <
typename T,
size_t N>
957template <
typename T, T N>
973template <
typename... Ts>
978#ifdef PHMAP_HAVE_STD_OPTIONAL
980using std::in_place_t;
996#if defined(PHMAP_HAVE_STD_ANY) || defined(PHMAP_HAVE_STD_VARIANT)
997using std::in_place_type_t;
1005template <
typename T>
1009#ifdef PHMAP_HAVE_STD_VARIANT
1010using std::in_place_index_t;
1028template <
typename T>
1037template <
typename T>
1040 return static_cast<T&&
>(t);
1043namespace utility_internal {
1045template <
typename Functor,
typename Tuple, std::size_t... Indexes>
1048 phmap::forward<Functor>(functor),
1049 std::get<Indexes>(phmap::forward<Tuple>(t))...)) {
1051 phmap::forward<Functor>(functor),
1052 std::get<Indexes>(phmap::forward<Tuple>(t))...);
1096template <
typename Functor,
typename Tuple>
1099 phmap::forward<Functor>(functor), phmap::forward<Tuple>(t),
1101 typename std::remove_reference<Tuple>::type>::value>{})) {
1103 phmap::forward<Functor>(functor), phmap::forward<Tuple>(t),
1105 typename std::remove_reference<Tuple>::type>::value>{});
1109 #pragma warning(push)
1110 #pragma warning(disable : 4365)
1126template <
typename T,
typename U = T>
1130 obj = phmap::forward<U>(new_value);
1135 #pragma warning(pop)
1147template <
typename T>
1150 static_assert(!std::is_array<T>::value,
"array types are unsupported");
1151 static_assert(std::is_object<T>::value,
"non-object types are unsupported");
1152 return std::unique_ptr<T>(ptr);
1155namespace memory_internal {
1158template <
typename T>
1162template <
typename T>
1166template <
typename T,
size_t N>
1173#if (__cplusplus > 201103L || defined(_MSC_VER)) && \
1174 !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ == 8)
1175 using std::make_unique;
1178 template <
typename T,
typename... Args>
1181 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
1184 template <
typename T>
1189 template <
typename T,
typename... Args>
1191 Args&&... ) =
delete;
1194template <
typename T>
1195auto RawPtr(T&& ptr) ->
decltype(std::addressof(*ptr))
1198 return (ptr !=
nullptr) ? std::addressof(*ptr) :
nullptr;
1201inline std::nullptr_t
RawPtr(std::nullptr_t) {
return nullptr; }
1203template <
typename T,
typename D>
1205 return ptr ? std::shared_ptr<T>(std::move(ptr)) : std::shared_ptr<T>();
1208template <
typename T>
1210 return std::weak_ptr<T>(ptr);
1213namespace memory_internal {
1216template <
template <
typename>
class Extract,
typename Obj,
typename Default,
1222template <
template <
typename>
class Extract,
typename Obj,
typename Default>
1227template <
template <
typename>
class Extract,
typename Obj,
typename Default>
1231template <
typename T>
1234template <
typename T>
1237template <
typename T>
1240template <
typename T>
1243template <
typename T>
1246template <
typename T>
1249template <
typename T>
1251 typename T::propagate_on_container_copy_assignment;
1253template <
typename T>
1255 typename T::propagate_on_container_move_assignment;
1257template <
typename T>
1260template <
typename T>
1263template <
typename T>
1266template <
template <
typename...>
class Class,
typename T,
typename... Args>
1271template <
typename Ptr,
typename =
void>
1276template <
typename T>
1278 using type =
typename T::element_type;
1281template <
typename T,
typename U>
1284template <
template <
typename...>
class Class,
typename T,
typename... Args,
1290template <
typename T,
typename U,
typename =
void>
1295template <
typename T,
typename U>
1297 using type =
typename T::template rebind<U>;
1300template <
typename T,
typename U>
1305template <
typename T,
typename U>
1306constexpr bool HasRebindAlloc(
typename std::allocator_traits<T>::template rebind_alloc<U>*) {
1310template <typename T, typename U, bool = HasRebindAlloc<T, U>(
nullptr)>
1315template <
typename A,
typename U>
1317 using type =
typename std::allocator_traits<A>::template rebind_alloc<U>;
1323template <
typename Ptr>
1342 template <
typename U>
1348 return Ptr::pointer_to(r);
1353template <
typename T>
1360 template <
typename U>
1367 return std::addressof(r);
1377template <
typename Alloc>
1397 template rebind<const value_type>>;
1425 typename std::make_unsigned<difference_type>::type>;
1445 Alloc, std::false_type>;
1451 typename std::is_empty<Alloc>::type>;
1456 template <
typename T>
1461 template <
typename T>
1468 return a.allocate(n);
1490 template <
typename T,
typename... Args>
1498 template <
typename T>
1516 template <
typename A>
1519 ->
decltype(a.allocate(n, hint)) {
1520 return a.allocate(n, hint);
1524 return a.allocate(n);
1527 template <
typename A,
typename... Args>
1530 ->
decltype(std::allocator_traits<A>::construct(a, std::forward<Args>(args)...)) {
1531 std::allocator_traits<A>::construct(a, std::forward<Args>(args)...);
1534 template <
typename T,
typename... Args>
1536 ::new (
static_cast<void*
>(p)) T(std::forward<Args>(args)...);
1539 template <
typename A,
typename T>
1541 T* p) ->
decltype(std::allocator_traits<A>::destroy(a, p)) {
1542 std::allocator_traits<A>::destroy(a, p);
1544 template <
typename T>
1549 template <
typename A>
1551 return a.max_size();
1554 return (std::numeric_limits<size_type>::max)() /
sizeof(
value_type);
1557 template <
typename A>
1559 ->
decltype(a.select_on_container_copy_construction()) {
1560 return a.select_on_container_copy_construction();
1568namespace memory_internal {
1572template <
typename Alloc>
1596template <
typename Alloc>
1599 std::false_type> {};
1601#if defined(PHMAP_ALLOCATOR_NOTHROW) && PHMAP_ALLOCATOR_NOTHROW
1602 template <
typename T>
1604 struct default_allocator_is_nothrow : std::true_type {};
1609namespace memory_internal {
1610template <
typename Allocator,
typename Iterator,
typename... Args>
1612 const Args&... args)
1614 for (Iterator cur = first; cur != last; ++cur) {
1616 std::allocator_traits<Allocator>::construct(alloc, std::addressof(*cur),
1620 while (cur != first) {
1622 std::allocator_traits<Allocator>::destroy(alloc, std::addressof(*cur));
1629template <
typename Allocator,
typename Iterator,
typename InputIterator>
1633 for (Iterator cur = destination; first != last;
1634 static_cast<void>(++cur),
static_cast<void>(++first)) {
1636 std::allocator_traits<Allocator>::construct(alloc, std::addressof(*cur),
1640 while (cur != destination) {
1642 std::allocator_traits<Allocator>::destroy(alloc, std::addressof(*cur));
1655#ifdef PHMAP_HAVE_STD_OPTIONAL
1660using std::bad_optional_access;
1662using std::make_optional;
1663using std::nullopt_t;
1669#if defined(__clang__)
1670 #if __has_feature(cxx_inheriting_constructors)
1671 #define PHMAP_OPTIONAL_USE_INHERITING_CONSTRUCTORS 1
1673#elif (defined(__GNUC__) && \
1674 (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 8)) || \
1675 (__cpp_inheriting_constructors >= 200802) || \
1676 (defined(_MSC_VER) && _MSC_VER >= 1910)
1678 #define PHMAP_OPTIONAL_USE_INHERITING_CONSTRUCTORS 1
1688 const char*
what() const noexcept override;
1691template <typename T>
1705namespace optional_internal {
1716template <typename T, bool unused = std::is_trivially_destructible<T>::value>
1720 static_assert(
sizeof(T) %
sizeof(
empty_struct) == 0,
"");
1744 template <
typename... Args>
1752template <
typename T>
1756 static_assert(
sizeof(T) %
sizeof(
empty_struct) == 0,
"");
1774 template <
typename... Args>
1779template <
typename T>
1784#if PHMAP_OPTIONAL_USE_INHERITING_CONSTRUCTORS
1789 template <
typename... Args>
1794 template <
typename... Args>
1797 ::new (
static_cast<void*
>(&this->dummy_)) T(std::forward<Args>(args)...);
1798 this->engaged_ =
true;
1801 template <
typename U>
1803 if (this->engaged_) {
1804 this->data_ = std::forward<U>(u);
1806 construct(std::forward<U>(u));
1817template <
typename T,
1820 T>::type>::value&& std::is_trivially_destructible<T>::value>
1824template <
typename T>
1828#if PHMAP_OPTIONAL_USE_INHERITING_CONSTRUCTORS
1833 template <
typename... Args>
1839template <
typename T>
1843#if PHMAP_OPTIONAL_USE_INHERITING_CONSTRUCTORS
1846 template <
typename... Args>
1855 this->construct(rhs.data_);
1860 phmap::default_allocator_is_nothrow::value ||
1861 std::is_nothrow_move_constructible<T>::value)
1864 this->construct(std::move(rhs.data_));
1870 this->assign(rhs.data_);
1878 std::is_nothrow_move_assignable<T>::value&&
1879 std::is_nothrow_move_constructible<T>::value) {
1881 this->assign(std::move(rhs.data_));
1894template <copy_traits>
1931template <copy_traits>
1967template <
typename T>
1970 return std::is_copy_constructible<T>::value
1971 ? copy_traits::copyable
1972 : std::is_move_constructible<T>::value ? copy_traits::movable
1973 : copy_traits::non_movable;
1976template <
typename T>
1980 std::is_copy_constructible<T>::value
1981 ? copy_traits::copyable
1983 std::is_move_constructible<T>::value
1984 ? copy_traits::movable
1985 : copy_traits::non_movable;
1989template <
typename T,
typename U>
1991 : std::integral_constant<
1992 bool, std::is_constructible<T, optional<U>&>::value ||
1993 std::is_constructible<T, optional<U>&&>::value ||
1994 std::is_constructible<T, const optional<U>&>::value ||
1995 std::is_constructible<T, const optional<U>&&>::value ||
1996 std::is_convertible<optional<U>&, T>::value ||
1997 std::is_convertible<optional<U>&&, T>::value ||
1998 std::is_convertible<const optional<U>&, T>::value ||
1999 std::is_convertible<const optional<U>&&, T>::value> {};
2002template <
typename T,
typename U>
2004 : std::integral_constant<
2005 bool, is_constructible_convertible_from_optional<T, U>::value ||
2006 std::is_assignable<T&, optional<U>&>::value ||
2007 std::is_assignable<T&, optional<U>&&>::value ||
2008 std::is_assignable<T&, const optional<U>&>::value ||
2009 std::is_assignable<T&, const optional<U>&&>::value> {};
2019template <
typename T,
typename =
size_t>
2029template <
typename T>
2031 std::declval<phmap::remove_const_t<T> >()))>
2036 phmap::type_traits_internal::AssertHashEnabled<phmap::remove_const_t<T>>();
2038 return std::hash<phmap::remove_const_t<T> >()(*opt);
2040 return static_cast<size_t>(0x297814aaad196e6dULL);
2052template <
typename T>
2055 optional_internal::get_ctor_copy_traits<T>()>,
2057 optional_internal::get_assign_copy_traits<T>()>
2083 template <
typename InPlaceT,
typename... Args,
2085 std::is_same<InPlaceT, in_place_t>,
2086 std::is_constructible<T, Args&&...> >::value>* =
nullptr>
2094 template <
typename U,
typename... Args,
2095 typename =
typename std::enable_if<std::is_constructible<
2096 T, std::initializer_list<U>&, Args&&...>::value>::type>
2105 typename std::enable_if<
2110 std::is_convertible<U&&, T>,
2111 std::is_constructible<T, U&&> >::value,
2112 bool>::type =
false>
2118 typename std::enable_if<
2124 std::is_constructible<T, U&&>>::value,
2125 bool>::type =
false>
2130 template <
typename U,
2131 typename std::enable_if<
2134 std::is_constructible<T, const U&>,
2137 is_constructible_convertible_from_optional<T, U> >,
2138 std::is_convertible<const U&, T> >::value,
2139 bool>::type =
false>
2142 this->construct(*rhs);
2147 template <
typename U,
2148 typename std::enable_if<
2151 std::is_constructible<T, const U&>,
2154 is_constructible_convertible_from_optional<T, U>>,
2156 bool>::type =
false>
2159 this->construct(*rhs);
2164 template <
typename U,
2165 typename std::enable_if<
2168 std::is_constructible<T, U&&>,
2171 is_constructible_convertible_from_optional<T, U> >,
2172 std::is_convertible<U&&, T> >::value,
2173 bool>::type =
false>
2176 this->construct(std::move(*rhs));
2183 typename std::enable_if<
2190 bool>::type =
false>
2193 this->construct(std::move(*rhs));
2224 std::is_same<optional<T>,
typename std::decay<U>::type>>,
2227 std::is_same<T, typename std::decay<U>::type>>>,
2228 std::is_constructible<T, U>, std::is_assignable<T&, U>>::value>::type>
2230 this->assign(std::forward<U>(v));
2238 std::is_constructible<T, const U&>, std::is_assignable<T&, const U&>,
2241 is_constructible_convertible_assignable_from_optional<
2242 T, U>>>::value>::type>
2252 template <
typename U,
2255 std::is_assignable<T&, U>,
2258 is_constructible_convertible_assignable_from_optional<
2259 T, U>>>::value>::type>
2262 this->assign(std::move(*rhs));
2289 template <
typename... Args,
2290 typename =
typename std::enable_if<
2291 std::is_constructible<T, Args&&...>::value>::type>
2294 this->construct(std::forward<Args>(args)...);
2309 template <
typename U,
typename... Args,
2310 typename =
typename std::enable_if<std::is_constructible<
2311 T, std::initializer_list<U>&, Args&&...>::value>::type>
2312 T&
emplace(std::initializer_list<U> il, Args&&... args) {
2314 this->construct(il, std::forward<Args>(args)...);
2322 std::is_nothrow_move_constructible<T>::value&&
2323 std::is_trivial<T>::value) {
2329 rhs.construct(std::move(**
this));
2334 this->construct(std::move(*rhs));
2351 assert(this->engaged_);
2352 return std::addressof(this->data_);
2355 assert(this->engaged_);
2356 return std::addressof(this->data_);
2363 constexpr const T&
operator*() const & {
return reference(); }
2365 assert(this->engaged_);
2372 assert(this->engaged_);
2373 return std::move(reference());
2386 constexpr explicit operator bool() const noexcept {
return this->engaged_; }
2392 constexpr bool has_value() const noexcept {
return this->engaged_; }
2397 #pragma warning(push)
2398 #pragma warning(disable : 4702)
2407 return static_cast<bool>(*this)
2409 : (optional_internal::throw_bad_optional_access(), reference());
2412 return static_cast<bool>(*this)
2414 : (optional_internal::throw_bad_optional_access(), reference());
2418 static_cast<bool>(*
this)
2420 : (optional_internal::throw_bad_optional_access(), reference()));
2424 static_cast<bool>(*
this)
2426 : (optional_internal::throw_bad_optional_access(), reference()));
2429 #pragma warning(pop)
2436 template <
typename U>
2438 static_assert(std::is_copy_constructible<value_type>::value,
2439 "optional<T>::value_or: T must by copy constructible");
2440 static_assert(std::is_convertible<U&&, value_type>::value,
2441 "optional<T>::value_or: U must be convertible to T");
2442 return static_cast<bool>(*this)
2444 :
static_cast<T
>(phmap::forward<U>(v));
2446 template <
typename U>
2448 static_assert(std::is_move_constructible<value_type>::value,
2449 "optional<T>::value_or: T must by move constructible");
2450 static_assert(std::is_convertible<U&&, value_type>::value,
2451 "optional<T>::value_or: U must be convertible to T");
2452 return static_cast<bool>(*this) ? std::move(**
this)
2453 :
static_cast<T
>(std::forward<U>(v));
2458 constexpr const T&
reference()
const {
return this->data_; }
2464 !std::is_same<nullopt_t, typename std::remove_cv<T>::type>::value,
2465 "optional<nullopt_t> is not allowed.");
2467 !std::is_same<in_place_t, typename std::remove_cv<T>::type>::value,
2468 "optional<in_place_t> is not allowed.");
2469 static_assert(!std::is_reference<T>::value,
2470 "optional<reference> is not allowed.");
2482template <
typename T,
2483 typename std::enable_if<std::is_move_constructible<T>::value,
2484 bool>::type =
false>
2504template <
typename T>
2509template <
typename T,
typename... Args>
2514template <
typename T,
typename U,
typename... Args>
2518 phmap::forward<Args>(args)...);
2535template <
typename T,
typename U>
2538 return static_cast<bool>(x) !=
static_cast<bool>(y)
2540 :
static_cast<bool>(x) ==
false ?
true
2541 :
static_cast<bool>(*x == *y);
2546template <
typename T,
typename U>
2549 return static_cast<bool>(x) !=
static_cast<bool>(y)
2551 :
static_cast<bool>(x) ==
false ?
false
2552 :
static_cast<bool>(*x != *y);
2555template <
typename T,
typename U>
2558 return !y ?
false : !x ?
true :
static_cast<bool>(*x < *y);
2561template <
typename T,
typename U>
2564 return !x ?
false : !y ?
true :
static_cast<bool>(*x > *y);
2567template <
typename T,
typename U>
2570 return !x ?
true : !y ?
false :
static_cast<bool>(*x <= *y);
2573template <
typename T,
typename U>
2576 return !y ?
true : !x ?
false :
static_cast<bool>(*x >= *y);
2581template <
typename T>
2585template <
typename T>
2589template <
typename T>
2591 return static_cast<bool>(x);
2593template <
typename T>
2595 return static_cast<bool>(x);
2597template <
typename T>
2601template <
typename T>
2603 return static_cast<bool>(x);
2605template <
typename T>
2609template <
typename T>
2613template <
typename T>
2615 return static_cast<bool>(x);
2617template <
typename T>
2621template <
typename T>
2625template <
typename T>
2635template <
typename T,
typename U>
2638 return static_cast<bool>(x) ?
static_cast<bool>(*x == v) :
false;
2640template <
typename T,
typename U>
2643 return static_cast<bool>(x) ?
static_cast<bool>(v == *x) :
false;
2645template <
typename T,
typename U>
2648 return static_cast<bool>(x) ?
static_cast<bool>(*x != v) :
true;
2650template <
typename T,
typename U>
2653 return static_cast<bool>(x) ?
static_cast<bool>(v != *x) :
true;
2655template <
typename T,
typename U>
2658 return static_cast<bool>(x) ?
static_cast<bool>(*x < v) :
true;
2660template <
typename T,
typename U>
2663 return static_cast<bool>(x) ?
static_cast<bool>(v < *x) :
false;
2665template <
typename T,
typename U>
2668 return static_cast<bool>(x) ?
static_cast<bool>(*x <= v) :
true;
2670template <
typename T,
typename U>
2673 return static_cast<bool>(x) ?
static_cast<bool>(v <= *x) :
false;
2675template <
typename T,
typename U>
2678 return static_cast<bool>(x) ?
static_cast<bool>(*x > v) :
false;
2680template <
typename T,
typename U>
2683 return static_cast<bool>(x) ?
static_cast<bool>(v > *x) :
true;
2685template <
typename T,
typename U>
2688 return static_cast<bool>(x) ?
static_cast<bool>(*x >= v) :
false;
2690template <
typename T,
typename U>
2693 return static_cast<bool>(x) ?
static_cast<bool>(v >= *x) :
true;
2701template <
typename T>
2715template <
class,
class =
void>
2719 : std::true_type {};
2721template <
bool is_transparent>
2725 template <
typename K,
typename key_type>
2733 template <
typename K,
typename key_type>
2738 #pragma warning(push)
2740 #pragma warning(disable : 4820)
2747template <
typename PolicyTraits,
typename Alloc>
2759 *
this = std::move(other);
2766 if (!other.empty()) {
2768 PolicyTraits::transfer(
alloc(),
slot(), other.slot());
2775 explicit operator bool() const noexcept {
return !
empty(); }
2784 PolicyTraits::transfer(
alloc(),
slot(), s);
2790 PolicyTraits::construct(
alloc(),
slot(), s);
2794 PolicyTraits::transfer(
alloc(),
slot(), s);
2825 #pragma warning(pop)
2830template <
typename Policy,
typename PolicyTraits,
typename Alloc,
2843 value_type&
key()
const {
return PolicyTraits::element(this->
slot()); }
2853template <
typename Policy,
typename PolicyTraits,
typename Alloc>
2868 return PolicyTraits::key(this->
slot());
2872 return PolicyTraits::value(&PolicyTraits::element(this->
slot()));
2884 template <
typename Node>
2885 static auto GetSlot(
const Node& node) ->
decltype(node.slot()) {
2889 template <
typename Node>
2894 template <
typename Node>
2899 template <
typename T,
typename... Args>
2901 return T(std::forward<Args>(args)...);
2904 template <
typename T,
typename... Args>
2906 return T(
typename T::transfer_tag_t{}, std::forward<Args>(args)...);
2909 template <
typename T,
typename... Args>
2911 return T(
typename T::move_tag_t{}, std::forward<Args>(args)...);
2916template <
class Iterator,
class NodeType>
2928#ifdef ADDRESS_SANITIZER
2929 #include <sanitizer/asan_interface.h>
2938template <
typename T>
2941namespace span_internal {
2943constexpr size_t Min(
size_t a,
size_t b)
noexcept {
return a < b ? a : b; }
2946template <
typename C>
2948 ->
decltype(c.data()) {
2958template <
typename C>
2965template <
typename C>
2967 std::is_integral<phmap::decay_t<decltype(std::declval<C&>().size())>>;
2975template <
typename T,
typename C>
2977 std::is_convertible<phmap::decay_t<decltype(GetData(std::declval<C&>()))>*,
2981template <
typename C>
2986template <
typename T,
size_t N>
2991template <
typename C>
2994template <
typename T>
2996 typename std::enable_if<!std::is_const<T>::value,
int>::type;
2998template <
typename T>
3000 static_assert(std::is_const<T>::value,
"");
3004template <
typename T>
3006 static_assert(std::is_const<T>::value,
"");
3007 return std::lexicographical_compare(a.
begin(), a.
end(), b.
begin(), b.
end());
3014template <
typename From,
typename To>
3022template <
typename From,
typename To>
3027template <
typename From,
typename To>
3029 typename std::enable_if<IsConvertible<From, Span<const To>>::value>::type;
3109template <
typename T>
3115 template <
typename C>
3117 typename std::enable_if<span_internal::HasData<T, C>::value &&
3121 template <
typename U>
3123 typename std::enable_if<std::is_const<T>::value, U>::type;
3126 template <
typename U>
3128 typename std::enable_if<!std::is_const<T>::value, U>::type;
3156 template <
typename V,
typename = EnableIfConvertibleFrom<V>,
3157 typename = EnableIfMutableView<V>>
3162 template <
typename V,
typename = EnableIfConvertibleFrom<V>,
3163 typename = EnableIfConstView<V>>
3164 constexpr Span(
const V& v)
noexcept
3202 template <
typename LazyT = T,
3203 typename = EnableIfConstView<LazyT>>
3205 std::initializer_list<value_type> v)
noexcept
3206 :
Span(v.begin(), v.size()) {}
3229 constexpr bool empty() const noexcept {
return size() == 0; }
3236 return *(
data() + i);
3246 "Span::at failed bounds check"),
3314 assert(
size() >= n);
3323 assert(
size() >= n);
3344 return (pos <=
size())
3361 return (len <=
size())
3378 return (len <=
size())
3384 template <
typename H>
3386 return H::combine(H::combine_contiguous(std::move(h), v.
data(), v.
size()),
3395template <
typename T>
3413template <
typename T>
3415 return span_internal::EqualImpl<const T>(a, b);
3418template <
typename T>
3420 return span_internal::EqualImpl<const T>(a, b);
3423template <
typename T>
3425 return span_internal::EqualImpl<const T>(a, b);
3428template <
typename T,
typename U,
3429 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3431 return span_internal::EqualImpl<const T>(a, b);
3434template <
typename T,
typename U,
3435 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3437 return span_internal::EqualImpl<const T>(a, b);
3441template <
typename T>
3446template <
typename T>
3451template <
typename T>
3456template <
typename T,
typename U,
3457 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3462template <
typename T,
typename U,
3463 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3469template <
typename T>
3471 return span_internal::LessThanImpl<const T>(a, b);
3474template <
typename T>
3475bool operator<(Span<const T> a, Span<T> b) {
3476 return span_internal::LessThanImpl<const T>(a, b);
3479template <
typename T>
3480bool operator<(Span<T> a, Span<const T> b) {
3481 return span_internal::LessThanImpl<const T>(a, b);
3484template <
typename T,
typename U,
3485 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3487 return span_internal::LessThanImpl<const T>(a, b);
3490template <
typename T,
typename U,
3491 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3493 return span_internal::LessThanImpl<const T>(a, b);
3497template <
typename T>
3502template <
typename T>
3503bool operator>(Span<const T> a, Span<T> b) {
3507template <
typename T>
3508bool operator>(Span<T> a, Span<const T> b) {
3512template <
typename T,
typename U,
3513 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3518template <
typename T,
typename U,
3519 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3525template <
typename T>
3530template <
typename T>
3535template <
typename T>
3540template <
typename T,
typename U,
3541 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3546template <
typename T,
typename U,
3547 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3553template <
typename T>
3558template <
typename T>
3563template <
typename T>
3568template <
typename T,
typename U,
3569 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3574template <
typename T,
typename U,
3575 typename = span_internal::EnableIfConvertibleToSpanConst<U, T>>
3616template <
int&... ExplicitArgumentBarrier,
typename T>
3621template <
int&... ExplicitArgumentBarrier,
typename T>
3626template <
int&... ExplicitArgumentBarrier,
typename C>
3632template <
int&... ExplicitArgumentBarrier,
typename T,
size_t N>
3661template <
int&... ExplicitArgumentBarrier,
typename T>
3666template <
int&... ExplicitArgumentBarrier,
typename T>
3671template <
int&... ExplicitArgumentBarrier,
typename C>
3676template <
int&... ExplicitArgumentBarrier,
typename T,
size_t N>
3695template <
class T,
size_t N>
3698namespace internal_layout {
3703template <
class T,
size_t N>
3705 static_assert(
sizeof(T) == 0,
"Aligned<T, N> cannot be const-qualified");
3719template <
class T,
size_t N>
3727template <
class T,
size_t N>
3733 static constexpr size_t value =
alignof(T);
3736template <
class T,
size_t N>
3738 static_assert(N %
alignof(T) == 0,
3739 "Custom alignment can't be lower than the type's alignment");
3744template <
class T,
class... Ts>
3747template <
class From,
class To>
3749 typename std::conditional<std::is_const<From>::value,
const To, To>::type;
3758namespace adl_barrier {
3760template <
class Needle,
class... Ts>
3761constexpr size_t Find(Needle, Needle, Ts...) {
3762 static_assert(!
Contains<Needle, Ts...>(),
"Duplicate element type");
3766template <
class Needle,
class T,
class... Ts>
3767constexpr size_t Find(Needle, T, Ts...) {
3771constexpr bool IsPow2(
size_t n) {
return !(n & (n - 1)); }
3775constexpr size_t Align(
size_t n,
size_t m) {
return (n + m - 1) & ~(m - 1); }
3777constexpr size_t Min(
size_t a,
size_t b) {
return b < a ? b : a; }
3779constexpr size_t Max(
size_t a) {
return a; }
3781template <
class... Ts>
3782constexpr size_t Max(
size_t a,
size_t b, Ts... rest) {
3795 bool, !std::is_reference<T>::value && !std::is_volatile<T>::value &&
3796 !std::is_reference<typename Type<T>::type>::value &&
3797 !std::is_volatile<typename Type<T>::type>::value &&
3800template <
class Elements,
class SizeSeq,
class OffsetSeq>
3816template <
class... Elements,
size_t... SizeSeq,
size_t... OffsetSeq>
3821 static_assert(
sizeof...(Elements) > 0,
"At least one field is required");
3823 "Invalid element type (see IsLegalElementType)");
3826 NumTypes =
sizeof...(Elements),
3827 NumSizes =
sizeof...(SizeSeq),
3828 NumOffsets =
sizeof...(OffsetSeq),
3834 static_assert(NumTypes > 0,
"Internal error");
3848 AlignOf<
typename std::tuple_element<N, std::tuple<Elements...>>::type>;
3856 using ElementType =
typename std::tuple_element<N, ElementTypes>::type;
3859 : size_{sizes...} {}
3875 template <
size_t N, EnableIf<N == 0> = 0>
3880 template <
size_t N, EnableIf<N != 0> = 0>
3882 static_assert(N < NumOffsets,
"Index out of bounds");
3898 return Offset<ElementIndex<T>()>();
3902 constexpr std::array<size_t, NumOffsets>
Offsets()
const {
3903 return {{Offset<OffsetSeq>()...}};
3917 static_assert(N < NumSizes,
"Index out of bounds");
3931 return Size<ElementIndex<T>()>();
3935 constexpr std::array<size_t, NumSizes>
Sizes()
const {
3936 return {{Size<SizeSeq>()...}};
3951 template <
size_t N,
class Char>
3953 using C =
typename std::remove_const<Char>::type;
3955 std::is_same<C, char>() || std::is_same<C, unsigned char>() ||
3956 std::is_same<C, signed char>(),
3957 "The argument must be a pointer to [const] [signed|unsigned] char");
3958 constexpr size_t alignment = Alignment();
3960 assert(
reinterpret_cast<uintptr_t
>(p) % alignment == 0);
3977 template <
class T,
class Char>
3979 return Pointer<ElementIndex<T>()>(p);
3998 template <
class Char>
4000 Char,
typename std::tuple_element<OffsetSeq, ElementTypes>::type>*...>
4002 return std::tuple<CopyConst<Char, ElementType<OffsetSeq>>*...>(
4003 Pointer<OffsetSeq>(p)...);
4018 template <
size_t N,
class Char>
4035 template <
class T,
class Char>
4037 return Slice<ElementIndex<T>()>(p);
4056 template <
class Char>
4058 Char,
typename std::tuple_element<SizeSeq, ElementTypes>::type>>...>
4063 return std::tuple<SliceType<CopyConst<Char, ElementType<SizeSeq>>>...>(
4064 Slice<SizeSeq>(p)...);
4075 static_assert(NumTypes == NumSizes,
"You must specify sizes of all fields");
4076 return Offset<NumTypes - 1>() +
4094 static_assert(N < NumOffsets,
"Index out of bounds");
4096#ifdef ADDRESS_SANITIZER
4097 PoisonPadding<Char, N - 1>(p);
4102 ASAN_POISON_MEMORY_REGION(p + start, Offset<N>() - start);
4109 size_t size_[NumSizes > 0 ? NumSizes : 1];
4112template <
size_t NumSizes,
class... Ts>
4127template <
class... Ts>
4131 static_assert(
sizeof...(Ts) > 0,
"At least one field is required");
4134 "Invalid element type (see IsLegalElementType)");
4136 template <
size_t NumSizes>
4139 template <
class... Sizes>
4141 static_assert(
sizeof...(Sizes) <=
sizeof...(Ts),
"");
4142 return PartialType<
sizeof...(Sizes)>(phmap::forward<Sizes>(sizes)...);
4154 : internal_layout::LayoutType<sizeof...(Ts), Ts...>(sizes...) {}
4167 #define PHMAP_INTERNAL_COMPRESSED_TUPLE_DECLSPEC __declspec(empty_bases)
4169 #define PHMAP_INTERNAL_COMPRESSED_TUPLE_DECLSPEC
4175template <
typename... Ts>
4176class CompressedTuple;
4178namespace internal_compressed_tuple {
4180template <
typename D,
size_t I>
4182template <
typename... B,
size_t I>
4184 : std::tuple_element<I, std::tuple<B...>> {};
4185template <
typename D,
size_t I>
4194template <
typename T>
4196#if defined(__clang__) || defined(__GNUC__)
4197 return __is_final(T);
4203template <
typename T>
4205#ifdef __INTEL_COMPILER
4210 return std::is_class<T>::value && std::is_empty<T>::value && !IsFinal<T>();
4218template <
typename D,
size_t I,
bool = ShouldUseBase<ElemT<D, I>>()>
4228 T&&
get() && {
return std::move(*this).value; }
4231template <
typename D,
size_t I>
4238 constexpr const T&
get() const& {
return *
this; }
4241 T&&
get() && {
return std::move(*
this); }
4244template <
typename D,
typename I>
4247template <
typename... Ts,
size_t... I>
4254 :
Storage<CompressedTuple<Ts...>,
4255 std::integral_constant<size_t, I>::value>...
4282template <
typename... Ts>
4284 :
private internal_compressed_tuple::CompressedTupleImpl<
4285 CompressedTuple<Ts...>, phmap::index_sequence_for<Ts...>>
4308 return std::move(*
this)
4309 .internal_compressed_tuple::template Storage<CompressedTuple, I>::get();
4315 .internal_compressed_tuple::template Storage<CompressedTuple, I>::get();
4333 #pragma warning(push)
4335 #pragma warning(disable : 4324)
4348template <
size_t Alignment,
class Alloc>
4350 static_assert(Alignment > 0,
"");
4351 assert(n &&
"n must be positive");
4352 struct alignas(Alignment) M {};
4355 A mem_alloc(*alloc);
4356 void* p = AT::allocate(mem_alloc, (n +
sizeof(M) - 1) /
sizeof(M));
4357 assert(
reinterpret_cast<uintptr_t
>(p) % Alignment == 0 &&
4358 "allocator does not respect alignment");
4366template <
size_t Alignment,
class Alloc>
4368 static_assert(Alignment > 0,
"");
4369 assert(n &&
"n must be positive");
4370 struct alignas(Alignment) M {};
4373 A mem_alloc(*alloc);
4374 AT::deallocate(mem_alloc,
static_cast<M*
>(p),
4375 (n +
sizeof(M) - 1) /
sizeof(M));
4379 #pragma warning(pop)
4385#ifdef ADDRESS_SANITIZER
4386 ASAN_POISON_MEMORY_REGION(m, s);
4388#ifdef MEMORY_SANITIZER
4389 __msan_poison(m, s);
4396#ifdef ADDRESS_SANITIZER
4397 ASAN_UNPOISON_MEMORY_REGION(m, s);
4399#ifdef MEMORY_SANITIZER
4400 __msan_unpoison(m, s);
4406template <
typename T>
4411template <
typename T>
4424#if defined(__clang__)
4425 #define PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
4427 #define PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(x)
4430#define PHMAP_GUARDED_BY(x) PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
4431#define PHMAP_PT_GUARDED_BY(x) PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
4433#define PHMAP_ACQUIRED_AFTER(...) \
4434 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__))
4436#define PHMAP_ACQUIRED_BEFORE(...) \
4437 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__))
4439#define PHMAP_EXCLUSIVE_LOCKS_REQUIRED(...) \
4440 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__))
4442#define PHMAP_SHARED_LOCKS_REQUIRED(...) \
4443 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__))
4445#define PHMAP_LOCKS_EXCLUDED(...) \
4446 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__))
4448#define PHMAP_LOCK_RETURNED(x) \
4449 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
4451#define PHMAP_LOCKABLE \
4452 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(lockable)
4454#define PHMAP_SCOPED_LOCKABLE \
4455 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
4457#define PHMAP_EXCLUSIVE_LOCK_FUNCTION(...) \
4458 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__))
4460#define PHMAP_SHARED_LOCK_FUNCTION(...) \
4461 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__))
4463#define PHMAP_UNLOCK_FUNCTION(...) \
4464 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__))
4466#define PHMAP_EXCLUSIVE_TRYLOCK_FUNCTION(...) \
4467 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__))
4469#define PHMAP_SHARED_TRYLOCK_FUNCTION(...) \
4470 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__))
4472#define PHMAP_ASSERT_EXCLUSIVE_LOCK(...) \
4473 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__))
4475#define PHMAP_ASSERT_SHARED_LOCK(...) \
4476 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__))
4478#define PHMAP_NO_THREAD_SAFETY_ANALYSIS \
4479 PHMAP_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
4488#define PHMAP_TS_UNCHECKED(x) ""
4493#define PHMAP_TS_FIXME(x) ""
4500#define PHMAP_NO_THREAD_SAFETY_ANALYSIS_FIXME PHMAP_NO_THREAD_SAFETY_ANALYSIS
4505#define PHMAP_GUARDED_BY_FIXME(x)
4510#define PHMAP_TS_UNCHECKED_READ(x) thread_safety_analysis::ts_unchecked_read(x)
4514namespace thread_safety_analysis {
4518template <
typename T>
4523template <
typename T>
4532namespace memory_internal {
4542template <
class Pair,
class = std::true_type>
4544 static constexpr size_t kFirst = (size_t)-1;
4545 static constexpr size_t kSecond = (size_t)-1;
4548template <
class Pair>
4551 static constexpr size_t kFirst = offsetof(
Pair, first);
4552 static constexpr size_t kSecond = offsetof(
Pair, second);
4556template <
class K,
class V>
4568 return std::is_standard_layout<P>() &&
sizeof(P) ==
sizeof(
Pair) &&
4569 alignof(P) ==
alignof(
Pair) &&
4579 static constexpr bool value = std::is_standard_layout<K>() &&
4580 std::is_standard_layout<Pair>() &&
4582 LayoutCompatible<std::pair<K, V>>() &&
4583 LayoutCompatible<std::pair<const K, V>>();
4614template <
class K,
class V>
4632template <
class K,
class V>
4657 return kMutableKeys::value ? slot->
key : slot->
value.first;
4660 template <
class Allocator,
class... Args>
4663 if (kMutableKeys::value) {
4665 std::forward<Args>(args)...);
4668 std::forward<Args>(args)...);
4673 template <
class Allocator>
4676 if (kMutableKeys::value) {
4681 std::move(other->
value));
4685 template <
class Allocator>
4687 if (kMutableKeys::value) {
4694 template <
class Allocator>
4698 if (kMutableKeys::value) {
4703 std::move(old_slot->
value));
4705 destroy(alloc, old_slot);
4708 template <
class Allocator>
4710 if (kMutableKeys::value) {
4717 std::move(b->
value));
4724 template <
class Allocator>
4726 if (kMutableKeys::value) {
4731 std::move(src->
value));
4735 template <
class Allocator>
4738 for (
slot_type *src = first, *dest = result; src != last; ++src, ++dest)
4739 move(alloc, src, dest);
4749#ifdef BOOST_THREAD_LOCK_OPTIONS_HPP
4750 using defer_lock_t = boost::defer_lock_t;
4751 using try_to_lock_t = boost::try_to_lock_t;
4752 using adopt_lock_t = boost::adopt_lock_t;
4779template <
class MutexType>
4814 m_(&m), locked_(
true)
4818 m_(&m), locked_(
false)
4822 m_(&m), locked_(
false) {
4860 locked_ = m_->try_lock();
4867 std::swap(m_, o.m_);
4868 std::swap(locked_, o.locked_);
4892 m_(&m), locked_(
true)
4896 m_(&m), locked_(
false)
4900 m_(&m), locked_(
false) {
4901 m_->try_lock_shared();
4918 m_->unlock_shared();
4930 m_->unlock_shared();
4938 locked_ = m_->try_lock_shared();
4945 std::swap(m_, o.m_);
4946 std::swap(locked_, o.locked_);
5006 _m1.unlock_shared();
5007 _m2.unlock_shared();
5035template <
class Mtx_>
5069#ifdef ABSL_SYNCHRONIZATION_MUTEX_H_
5071 struct AbslMutex :
protected absl::Mutex
5073 void lock() { this->Lock(); }
5074 void unlock() { this->Unlock(); }
5075 void try_lock() { this->TryLock(); }
5076 void lock_shared() { this->ReaderLock(); }
5077 void unlock_shared() { this->ReaderUnlock(); }
5078 void try_lock_shared() { this->ReaderTryLock(); }
5082 class LockableImpl<absl::Mutex> :
public AbslMutex
5085 using mutex_type = phmap::AbslMutex;
5086 using Base = LockableBaseImpl<phmap::AbslMutex>;
5087 using SharedLock =
typename Base::ReadLock;
5088 using UpgradeLock =
typename Base::WriteLock;
5089 using UniqueLock =
typename Base::WriteLock;
5090 using SharedLocks =
typename Base::ReadLocks;
5091 using UniqueLocks =
typename Base::WriteLocks;
5092 using UpgradeToUnique =
typename Base::DoNothing;
5100#ifdef BOOST_THREAD_SHARED_MUTEX_HPP
5105 class LockableImpl<boost::shared_mutex> :
public boost::shared_mutex
5108 using mutex_type = boost::shared_mutex;
5109 using Base = LockableBaseImpl<boost::shared_mutex>;
5110 using SharedLock = boost::shared_lock<mutex_type>;
5111 using UpgradeLock = boost::unique_lock<mutex_type>;
5112 using UniqueLock = boost::unique_lock<mutex_type>;
5113 using SharedLocks =
typename Base::ReadLocks;
5114 using UniqueLocks =
typename Base::WriteLocks;
5115 using UpgradeToUnique =
typename Base::DoNothing;
5120 class LockableImpl<boost::upgrade_mutex> :
public boost::upgrade_mutex
5123 using mutex_type = boost::upgrade_mutex;
5124 using SharedLock = boost::shared_lock<mutex_type>;
5125 using UpgradeLock = boost::upgrade_lock<mutex_type>;
5126 using UniqueLock = boost::unique_lock<mutex_type>;
5127 using SharedLocks =
typename Base::ReadLocks;
5128 using UniqueLocks =
typename Base::WriteLocks;
5129 using UpgradeToUnique = boost::upgrade_to_unique_lock<mutex_type>;
5138#ifdef PHMAP_HAVE_SHARED_MUTEX
5142 class LockableImpl<
std::shared_mutex> :
public std::shared_mutex
5145 using mutex_type = std::shared_mutex;
5146 using Base = LockableBaseImpl<std::shared_mutex>;
5147 using SharedLock = std::shared_lock<mutex_type>;
5148 using UpgradeLock = std::unique_lock<mutex_type>;
5149 using UniqueLock = std::unique_lock<mutex_type>;
5150 using SharedLocks =
typename Base::ReadLocks;
5151 using UniqueLocks =
typename Base::WriteLocks;
5152 using UpgradeToUnique =
typename Base::DoNothing;
5160 #pragma warning(pop)
Definition phmap_base.h:4880
ReadLock(mutex_type &m)
Definition phmap_base.h:4886
bool locked_
Definition phmap_base.h:4953
mutex_type * mutex() const noexcept
Definition phmap_base.h:4949
ReadLock & operator=(ReadLock &&other)
Definition phmap_base.h:4910
ReadLock()
Definition phmap_base.h:4884
ReadLock(mutex_type &m, defer_lock_t) noexcept
Definition phmap_base.h:4895
~ReadLock()
Definition phmap_base.h:4916
ReadLock(mutex_type &m, adopt_lock_t) noexcept
Definition phmap_base.h:4891
bool try_lock()
Definition phmap_base.h:4935
void swap(ReadLock &o) noexcept
Definition phmap_base.h:4944
void unlock()
Definition phmap_base.h:4928
void lock()
Definition phmap_base.h:4921
ReadLock(mutex_type &m, try_to_lock_t)
Definition phmap_base.h:4899
ReadLock(ReadLock &&o)
Definition phmap_base.h:4904
mutex_type * m_
Definition phmap_base.h:4952
MutexType mutex_type
Definition phmap_base.h:4882
bool owns_lock() const noexcept
Definition phmap_base.h:4942
Definition phmap_base.h:4988
MutexType mutex_type
Definition phmap_base.h:4990
~ReadLocks()
Definition phmap_base.h:5004
ReadLocks(ReadLocks const &)=delete
ReadLocks(adopt_lock_t, mutex_type &m1, mutex_type &m2)
Definition phmap_base.h:4999
ReadLocks & operator=(ReadLocks const &)=delete
mutex_type & _m2
Definition phmap_base.h:5014
mutex_type & _m1
Definition phmap_base.h:5013
ReadLocks(mutex_type &m1, mutex_type &m2)
Definition phmap_base.h:4992
Definition phmap_base.h:4802
bool owns_lock() const noexcept
Definition phmap_base.h:4864
void swap(WriteLock &o) noexcept
Definition phmap_base.h:4866
WriteLock(mutex_type &m, defer_lock_t) noexcept
Definition phmap_base.h:4817
bool try_lock()
Definition phmap_base.h:4857
WriteLock()
Definition phmap_base.h:4806
bool locked_
Definition phmap_base.h:4875
WriteLock(mutex_type &m, adopt_lock_t) noexcept
Definition phmap_base.h:4813
WriteLock & operator=(WriteLock &&other)
Definition phmap_base.h:4832
WriteLock(WriteLock &&o)
Definition phmap_base.h:4826
void unlock()
Definition phmap_base.h:4850
mutex_type * m_
Definition phmap_base.h:4874
WriteLock(mutex_type &m, try_to_lock_t)
Definition phmap_base.h:4821
MutexType mutex_type
Definition phmap_base.h:4804
void lock()
Definition phmap_base.h:4843
mutex_type * mutex() const noexcept
Definition phmap_base.h:4871
~WriteLock()
Definition phmap_base.h:4838
WriteLock(mutex_type &m)
Definition phmap_base.h:4808
Definition phmap_base.h:4958
WriteLocks(adopt_lock_t, mutex_type &m1, mutex_type &m2)
Definition phmap_base.h:4968
mutex_type & _m1
Definition phmap_base.h:4982
MutexType mutex_type
Definition phmap_base.h:4960
WriteLocks(mutex_type &m1, mutex_type &m2)
Definition phmap_base.h:4962
~WriteLocks()
Definition phmap_base.h:4973
WriteLocks(WriteLocks const &)=delete
WriteLocks & operator=(WriteLocks const &)=delete
mutex_type & _m2
Definition phmap_base.h:4983
Definition phmap_base.h:4781
typename Base::DoNothing UpgradeToUnique
Definition phmap_base.h:5061
typename Base::DoNothing UniqueLocks
Definition phmap_base.h:5063
typename Base::DoNothing UniqueLock
Definition phmap_base.h:5060
typename Base::DoNothing UpgradeLock
Definition phmap_base.h:5059
typename Base::DoNothing SharedLock
Definition phmap_base.h:5058
typename Base::DoNothing SharedLocks
Definition phmap_base.h:5062
Definition phmap_base.h:5037
typename Base::WriteLock UpgradeLock
Definition phmap_base.h:5042
typename Base::WriteLock SharedLock
Definition phmap_base.h:5041
typename Base::DoNothing UpgradeToUnique
Definition phmap_base.h:5046
typename Base::WriteLocks UniqueLocks
Definition phmap_base.h:5045
typename Base::WriteLocks SharedLocks
Definition phmap_base.h:5044
Mtx_ mutex_type
Definition phmap_base.h:5039
typename Base::WriteLock UniqueLock
Definition phmap_base.h:5043
Definition phmap_base.h:4766
~NullMutex()
Definition phmap_base.h:4769
void unlock_shared()
Definition phmap_base.h:4774
NullMutex()
Definition phmap_base.h:4768
void unlock()
Definition phmap_base.h:4771
void lock_shared()
Definition phmap_base.h:4773
bool try_lock_shared()
Definition phmap_base.h:4775
void lock()
Definition phmap_base.h:4770
bool try_lock()
Definition phmap_base.h:4772
Definition phmap_base.h:3111
constexpr pointer data() const noexcept
Definition phmap_base.h:3214
constexpr Span(pointer array, size_type lgth) noexcept
Definition phmap_base.h:3146
constexpr Span subspan(size_type pos=0, size_type len=npos) const
Definition phmap_base.h:3343
pointer iterator
Definition phmap_base.h:3136
static const size_type npos
Definition phmap_base.h:3143
constexpr size_type length() const noexcept
Definition phmap_base.h:3224
std::reverse_iterator< iterator > reverse_iterator
Definition phmap_base.h:3138
ptrdiff_t difference_type
Definition phmap_base.h:3141
constexpr reference back() const noexcept
Definition phmap_base.h:3260
const T & const_reference
Definition phmap_base.h:3135
T * pointer
Definition phmap_base.h:3132
constexpr iterator begin() const noexcept
Definition phmap_base.h:3267
constexpr bool empty() const noexcept
Definition phmap_base.h:3229
constexpr Span(const V &v) noexcept
Definition phmap_base.h:3164
constexpr const_reverse_iterator crbegin() const noexcept
Definition phmap_base.h:3294
Span(std::initializer_list< value_type > v) noexcept
Definition phmap_base.h:3204
constexpr const_reverse_iterator crend() const noexcept
Definition phmap_base.h:3306
phmap::remove_cv_t< T > value_type
Definition phmap_base.h:3131
typename std::enable_if< span_internal::HasData< T, C >::value && span_internal::HasSize< C >::value >::type EnableIfConvertibleFrom
Definition phmap_base.h:3116
constexpr Span first(size_type len) const
Definition phmap_base.h:3360
const_pointer const_iterator
Definition phmap_base.h:3137
constexpr reference operator[](size_type i) const noexcept
Definition phmap_base.h:3234
constexpr reference front() const noexcept
Definition phmap_base.h:3253
constexpr Span() noexcept
Definition phmap_base.h:3145
void remove_prefix(size_type n) noexcept
Definition phmap_base.h:3313
typename std::enable_if< std::is_const< T >::value, U >::type EnableIfConstView
Definition phmap_base.h:3122
typename std::enable_if<!std::is_const< T >::value, U >::type EnableIfMutableView
Definition phmap_base.h:3127
const T * const_pointer
Definition phmap_base.h:3133
constexpr iterator end() const noexcept
Definition phmap_base.h:3277
T & reference
Definition phmap_base.h:3134
Span(V &v) noexcept
Definition phmap_base.h:3158
size_type len_
Definition phmap_base.h:3392
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition phmap_base.h:3139
size_t size_type
Definition phmap_base.h:3140
constexpr reverse_iterator rend() const noexcept
Definition phmap_base.h:3299
pointer ptr_
Definition phmap_base.h:3391
constexpr const_iterator cend() const noexcept
Definition phmap_base.h:3282
constexpr reverse_iterator rbegin() const noexcept
Definition phmap_base.h:3287
constexpr Span last(size_type len) const
Definition phmap_base.h:3377
constexpr size_type size() const noexcept
Definition phmap_base.h:3219
constexpr reference at(size_type i) const
Definition phmap_base.h:3242
friend H AbslHashValue(H h, Span v)
Definition phmap_base.h:3385
constexpr Span(T(&a)[N]) noexcept
Definition phmap_base.h:3151
constexpr const_iterator cbegin() const noexcept
Definition phmap_base.h:3272
void remove_suffix(size_type n) noexcept
Definition phmap_base.h:3322
Definition phmap_base.h:1684
bad_optional_access()=default
~bad_optional_access() override
const char * what() const noexcept override
optional_assign_base & operator=(const optional_assign_base &)=default
optional_assign_base(const optional_assign_base &)=default
optional_assign_base & operator=(optional_assign_base &&)=default
constexpr optional_assign_base()=default
optional_assign_base(optional_assign_base &&)=default
optional_assign_base & operator=(const optional_assign_base &)=delete
optional_assign_base & operator=(optional_assign_base &&)=default
optional_assign_base(optional_assign_base &&)=default
optional_assign_base(const optional_assign_base &)=default
constexpr optional_assign_base()=default
optional_assign_base & operator=(optional_assign_base &&)=delete
constexpr optional_assign_base()=default
optional_assign_base & operator=(const optional_assign_base &)=delete
optional_assign_base(optional_assign_base &&)=default
optional_assign_base(const optional_assign_base &)=default
Definition phmap_base.h:1932
optional_ctor_base(optional_ctor_base &&)=default
constexpr optional_ctor_base()=default
optional_ctor_base & operator=(optional_ctor_base &&)=default
optional_ctor_base(const optional_ctor_base &)=default
optional_ctor_base & operator=(const optional_ctor_base &)=default
optional_ctor_base(const optional_ctor_base &)=delete
optional_ctor_base(optional_ctor_base &&)=default
optional_ctor_base & operator=(optional_ctor_base &&)=default
constexpr optional_ctor_base()=default
optional_ctor_base & operator=(const optional_ctor_base &)=default
optional_ctor_base & operator=(const optional_ctor_base &)=default
optional_ctor_base(optional_ctor_base &&)=delete
constexpr optional_ctor_base()=default
optional_ctor_base(const optional_ctor_base &)=delete
optional_ctor_base & operator=(optional_ctor_base &&)=default
Definition phmap_base.h:1895
optional_data(optional_data &&rhs) noexcept(phmap::default_allocator_is_nothrow::value||std::is_nothrow_move_constructible< T >::value)
Definition phmap_base.h:1859
optional_data & operator=(optional_data &&rhs) noexcept(std::is_nothrow_move_assignable< T >::value &&std::is_nothrow_move_constructible< T >::value)
Definition phmap_base.h:1877
optional_data(const optional_data &rhs)
Definition phmap_base.h:1853
optional_data & operator=(const optional_data &rhs)
Definition phmap_base.h:1868
constexpr optional_data(in_place_t t, Args &&... args)
Definition phmap_base.h:1847
constexpr optional_data(in_place_t t, Args &&... args)
Definition phmap_base.h:1834
Definition phmap_base.h:1781
void construct(Args &&... args)
Definition phmap_base.h:1795
optional_data_base()=default
void assign(U &&u)
Definition phmap_base.h:1802
constexpr optional_data_base(in_place_t t, Args &&... args)
Definition phmap_base.h:1790
void destruct() noexcept
Definition phmap_base.h:1769
bool engaged_
Definition phmap_base.h:1763
constexpr optional_data_dtor_base() noexcept
Definition phmap_base.h:1772
constexpr optional_data_dtor_base(in_place_t, Args &&... args)
Definition phmap_base.h:1775
T data_
Definition phmap_base.h:1767
dummy_type dummy_
Definition phmap_base.h:1766
Definition phmap_base.h:1718
constexpr optional_data_dtor_base(in_place_t, Args &&... args)
Definition phmap_base.h:1745
~optional_data_dtor_base()
Definition phmap_base.h:1748
T data_
Definition phmap_base.h:1731
dummy_type dummy_
Definition phmap_base.h:1730
bool engaged_
Definition phmap_base.h:1727
constexpr optional_data_dtor_base() noexcept
Definition phmap_base.h:1742
void destruct() noexcept
Definition phmap_base.h:1734
Definition phmap_base.h:1821
Definition phmap_base.h:2058
T & value() &
Definition phmap_base.h:2411
constexpr optional() noexcept
Definition phmap_base.h:2068
const T * operator->() const
Definition phmap_base.h:2350
optional & operator=(nullopt_t) noexcept
Definition phmap_base.h:2208
T & emplace(std::initializer_list< U > il, Args &&... args)
Definition phmap_base.h:2312
constexpr T value_or(U &&v) const &
Definition phmap_base.h:2437
constexpr optional(InPlaceT, Args &&... args)
Definition phmap_base.h:2087
T && operator*() &&
Definition phmap_base.h:2371
constexpr const T && operator*() const &&
Definition phmap_base.h:2368
void swap(optional &rhs) noexcept(std::is_nothrow_move_constructible< T >::value &&std::is_trivial< T >::value)
Definition phmap_base.h:2321
optional & operator=(optional< U > &&rhs)
Definition phmap_base.h:2260
T value_type
Definition phmap_base.h:2062
T & reference()
Definition phmap_base.h:2459
optional & operator=(optional &&src)=default
constexpr const T && value() const &&
Definition phmap_base.h:2422
optional & operator=(const optional &src)=default
T && value() &&
Definition phmap_base.h:2416
T & operator*() &
Definition phmap_base.h:2364
constexpr const T & operator*() const &
Definition phmap_base.h:2363
PHMAP_ATTRIBUTE_REINITIALIZES void reset() noexcept
Definition phmap_base.h:2274
optional(const optional< U > &rhs)
Definition phmap_base.h:2140
constexpr optional(nullopt_t) noexcept
Definition phmap_base.h:2071
optional & operator=(U &&v)
Definition phmap_base.h:2229
optional(optional< U > &&rhs)
Definition phmap_base.h:2174
T & emplace(Args &&... args)
Definition phmap_base.h:2292
T * operator->()
Definition phmap_base.h:2354
constexpr bool has_value() const noexcept
Definition phmap_base.h:2392
constexpr const T & value() const &
Definition phmap_base.h:2406
T value_or(U &&v) &&
Definition phmap_base.h:2447
constexpr const T & reference() const
Definition phmap_base.h:2458
optional(const optional &src)=default
optional & operator=(const optional< U > &rhs)
Definition phmap_base.h:2243
constexpr optional(in_place_t, std::initializer_list< U > il, Args &&... args)
Definition phmap_base.h:2097
optional(optional &&src)=default
constexpr optional(U &&v)
Definition phmap_base.h:2113
Definition phmap_base.h:4286
constexpr const ElemT< I > & get() const &
Definition phmap_base.h:4302
constexpr CompressedTuple(Ts... base)
Definition phmap_base.h:4293
constexpr const ElemT< I > && get() const &&
Definition phmap_base.h:4313
ElemT< I > && get() &&
Definition phmap_base.h:4307
internal_compressed_tuple::ElemT< CompressedTuple, I > ElemT
Definition phmap_base.h:4289
ElemT< I > & get() &
Definition phmap_base.h:4297
constexpr CompressedTuple()=default
Definition phmap_base.h:4129
static constexpr PartialType< sizeof...(Sizes)> Partial(Sizes &&... sizes)
Definition phmap_base.h:4140
constexpr Layout(internal_layout::TypeToSize< Ts >... sizes)
Definition phmap_base.h:4153
constexpr size_t Offset() const
Definition phmap_base.h:3897
static constexpr size_t Alignment()
Definition phmap_base.h:3863
typename std::tuple_element< N, ElementTypes >::type ElementType
Definition phmap_base.h:3856
std::tuple< SliceType< CopyConst< Char, typename std::tuple_element< SizeSeq, ElementTypes >::type > >... > Slices(Char *p) const
Definition phmap_base.h:4059
constexpr size_t Offset() const
Definition phmap_base.h:3876
constexpr size_t Size() const
Definition phmap_base.h:3916
std::tuple< typename Type< Elements >::type... > ElementTypes
Definition phmap_base.h:3852
CopyConst< Char, T > * Pointer(Char *p) const
Definition phmap_base.h:3978
constexpr std::array< size_t, NumOffsets > Offsets() const
Definition phmap_base.h:3902
void PoisonPadding(const Char *p) const
Definition phmap_base.h:4088
constexpr size_t AllocSize() const
Definition phmap_base.h:4074
constexpr LayoutImpl(IntToSize< SizeSeq >... sizes)
Definition phmap_base.h:3858
SliceType< CopyConst< Char, ElementType< N > > > Slice(Char *p) const
Definition phmap_base.h:4019
CopyConst< Char, ElementType< N > > * Pointer(Char *p) const
Definition phmap_base.h:3952
SliceType< CopyConst< Char, T > > Slice(Char *p) const
Definition phmap_base.h:4036
std::tuple< CopyConst< Char, typename std::tuple_element< OffsetSeq, ElementTypes >::type > *... > Pointers(Char *p) const
Definition phmap_base.h:4001
constexpr std::array< size_t, NumSizes > Sizes() const
Definition phmap_base.h:3935
static constexpr size_t ElementIndex()
Definition phmap_base.h:3839
Definition phmap_base.h:3801
auto key() const -> decltype(PolicyTraits::key(this->slot()))
Definition phmap_base.h:2867
typename Policy::mapped_type mapped_type
Definition phmap_base.h:2863
constexpr node_handle()
Definition phmap_base.h:2865
typename PolicyTraits::slot_type slot_type
Definition phmap_base.h:2859
typename Policy::key_type key_type
Definition phmap_base.h:2862
mapped_type & mapped() const
Definition phmap_base.h:2871
Definition phmap_base.h:2749
phmap::optional< allocator_type > alloc_
Definition phmap_base.h:2820
allocator_type * alloc()
Definition phmap_base.h:2817
node_handle_base(node_handle_base &&other) noexcept
Definition phmap_base.h:2758
typename PolicyTraits::slot_type slot_type
Definition phmap_base.h:2751
allocator_type get_allocator() const
Definition phmap_base.h:2776
constexpr node_handle_base()
Definition phmap_base.h:2756
node_handle_base(const allocator_type &a, slot_type *s)
Definition phmap_base.h:2793
~node_handle_base()
Definition phmap_base.h:2762
Alloc allocator_type
Definition phmap_base.h:2754
node_handle_base(move_tag_t, const allocator_type &a, slot_type *s)
Definition phmap_base.h:2788
node_handle_base(transfer_tag_t, const allocator_type &a, slot_type *s)
Definition phmap_base.h:2782
bool empty() const noexcept
Definition phmap_base.h:2774
void destroy()
Definition phmap_base.h:2800
node_handle_base & operator=(node_handle_base &&other) noexcept
Definition phmap_base.h:2764
void reset()
Definition phmap_base.h:2807
phmap::aligned_storage_t< sizeof(slot_type), alignof(slot_type)> slot_space_
Definition phmap_base.h:2821
slot_type * slot() const
Definition phmap_base.h:2812
Definition phmap_base.h:2833
value_type & key() const
Definition phmap_base.h:2843
constexpr node_handle()
Definition phmap_base.h:2839
value_type & value() const
Definition phmap_base.h:2841
typename PolicyTraits::value_type value_type
Definition phmap_base.h:2837
static void ThrowStdRuntimeError(const std::string &what_arg)
Definition phmap_base.h:701
static void ThrowStdInvalidArgument(const std::string &what_arg)
Definition phmap_base.h:673
static void ThrowStdRangeError(const std::string &what_arg)
Definition phmap_base.h:708
static void ThrowStdOverflowError(const std::string &what_arg)
Definition phmap_base.h:715
static void ThrowStdDomainError(const std::string &what_arg)
Definition phmap_base.h:680
static void ThrowStdLengthError(const std::string &what_arg)
Definition phmap_base.h:687
static void ThrowStdUnderflowError(const std::string &what_arg)
Definition phmap_base.h:722
static void ThrowStdLogicError(const std::string &what_arg)
Definition phmap_base.h:667
InvokeT< F, Args... > Invoke(F &&f, Args &&... args)
Definition phmap_base.h:873
decltype(Invoker< F, Args... >::type::Invoke( std::declval< F >(), std::declval< Args >()...)) InvokeT
Definition phmap_base.h:867
static void ThrowStdBadAlloc()
Definition phmap_base.h:731
static void ThrowStdBadFunctionCall()
Definition phmap_base.h:729
static void ThrowStdOutOfRange(const std::string &what_arg)
Definition phmap_base.h:694
typename identity< T >::type identity_t
Definition phmap_base.h:601
constexpr bool HasRebindAlloc(...)
Definition phmap_base.h:1301
typename T::void_pointer GetVoidPointer
Definition phmap_base.h:1238
typename T::pointer GetPointer
Definition phmap_base.h:1232
void CopyRange(Allocator &alloc, Iterator destination, InputIterator first, InputIterator last)
Definition phmap_base.h:1630
typename T::propagate_on_container_copy_assignment GetPropagateOnContainerCopyAssignment
Definition phmap_base.h:1250
void ConstructRange(Allocator &alloc, Iterator first, Iterator last, const Args &... args)
Definition phmap_base.h:1611
typename T::const_void_pointer GetConstVoidPointer
Definition phmap_base.h:1241
typename T::const_pointer GetConstPointer
Definition phmap_base.h:1235
typename T::propagate_on_container_swap GetPropagateOnContainerSwap
Definition phmap_base.h:1258
typename T::size_type GetSizeType
Definition phmap_base.h:1247
typename T::propagate_on_container_move_assignment GetPropagateOnContainerMoveAssignment
Definition phmap_base.h:1254
typename T::is_always_equal GetIsAlwaysEqual
Definition phmap_base.h:1261
typename Alloc::is_nothrow GetIsNothrow
Definition phmap_base.h:1573
typename ExtractOr< Extract, Obj, Default, void >::type ExtractOrT
Definition phmap_base.h:1228
typename T::difference_type GetDifferenceType
Definition phmap_base.h:1244
constexpr copy_traits get_ctor_copy_traits()
Definition phmap_base.h:1968
void throw_bad_optional_access()
constexpr copy_traits get_assign_copy_traits()
Definition phmap_base.h:1977
bool convertible_to_bool(bool)
copy_traits
Definition phmap_base.h:1891
constexpr bool ShouldUseBase()
Definition phmap_base.h:4204
constexpr bool IsFinal()
Definition phmap_base.h:4195
typename Elem< D, I >::type ElemT
Definition phmap_base.h:4186
struct PHMAP_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTupleImpl
Definition phmap_base.h:4245
constexpr bool IsPow2(size_t n)
Definition phmap_base.h:3771
constexpr size_t Max(size_t a)
Definition phmap_base.h:3779
constexpr size_t Align(size_t n, size_t m)
Definition phmap_base.h:3775
constexpr size_t Min(size_t a, size_t b)
Definition phmap_base.h:3777
constexpr size_t Find(Needle, Needle, Ts...)
Definition phmap_base.h:3761
typename std::enable_if< C, int >::type EnableIf
Definition phmap_base.h:3789
typename std::conditional< std::is_const< From >::value, const To, To >::type CopyConst
Definition phmap_base.h:3748
size_t TypeToSize
Definition phmap_base.h:3712
size_t IntToSize
Definition phmap_base.h:3709
std::integral_constant< bool, !std::is_reference< T >::value &&!std::is_volatile< T >::value && !std::is_reference< typename Type< T >::type >::value && !std::is_volatile< typename Type< T >::type >::value && adl_barrier::IsPow2(AlignOf< T >::value)> IsLegalElementType
Definition phmap_base.h:3794
void Deallocate(Alloc *alloc, void *p, size_t n)
Definition phmap_base.h:4367
typename phmap::Pair< T1, T2 > Pair
Definition phmap_fwd_decl.h:65
void SanitizerPoisonObject(const T *object)
Definition phmap_base.h:4407
void * Allocate(Alloc *alloc, size_t n)
Definition phmap_base.h:4349
void SanitizerUnpoisonObject(const T *object)
Definition phmap_base.h:4412
typename phmap::Allocator< T > Allocator
Definition phmap_fwd_decl.h:61
void SanitizerPoisonMemoryRegion(const void *m, size_t s)
Definition phmap_base.h:4384
void SanitizerUnpoisonMemoryRegion(const void *m, size_t s)
Definition phmap_base.h:4395
bool LessThanImpl(Span< T > a, Span< T > b)
Definition phmap_base.h:3005
constexpr size_t Min(size_t a, size_t b) noexcept
Definition phmap_base.h:2943
typename std::enable_if< IsConvertible< From, Span< const To > >::value >::type EnableIfConvertibleToSpanConst
Definition phmap_base.h:3028
bool EqualImpl(Span< T > a, Span< T > b)
Definition phmap_base.h:2999
std::is_integral< phmap::decay_t< decltype(std::declval< C & >().size())> > HasSize
Definition phmap_base.h:2966
typename ElementType< C >::type ElementT
Definition phmap_base.h:2992
constexpr auto GetDataImpl(C &c, char) noexcept -> decltype(c.data())
Definition phmap_base.h:2947
constexpr auto GetData(C &c) noexcept -> decltype(GetDataImpl(c, 0))
Definition phmap_base.h:2959
typename std::enable_if<!std::is_const< T >::value, int >::type EnableIfMutable
Definition phmap_base.h:2995
std::is_convertible< phmap::decay_t< decltype(GetData(std::declval< C & >()))> *, T *const * > HasData
Definition phmap_base.h:2976
const T & ts_unchecked_read(const T &v) PHMAP_NO_THREAD_SAFETY_ANALYSIS
Definition phmap_base.h:4519
decltype(std::declval< T & >()=std::declval< T && >()) IsMoveAssignableImpl
Definition phmap_base.h:157
decltype(std::declval< T & >()=std::declval< const T & >()) IsCopyAssignableImpl
Definition phmap_base.h:153
void AssertHashEnabled()
Definition phmap_base.h:405
auto apply_helper(Functor &&functor, Tuple &&t, index_sequence< Indexes... >) -> decltype(phmap::base_internal::Invoke(phmap::forward< Functor >(functor), std::get< Indexes >(phmap::forward< Tuple >(t))...))
Definition phmap_base.h:1046
typename std::add_volatile< T >::type add_volatile_t
Definition phmap_base.h:282
typename std::remove_const< T >::type remove_const_t
Definition phmap_base.h:270
typename std::remove_volatile< T >::type remove_volatile_t
Definition phmap_base.h:273
typename std::decay< T >::type decay_t
Definition phmap_base.h:316
auto apply(Functor &&functor, Tuple &&t) -> decltype(utility_internal::apply_helper(phmap::forward< Functor >(functor), phmap::forward< Tuple >(t), phmap::make_index_sequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >{}))
Definition phmap_base.h:1097
auto RawPtr(T &&ptr) -> decltype(std::addressof(*ptr))
Definition phmap_base.h:1195
constexpr T && forward(phmap::remove_reference_t< T > &t) noexcept
Definition phmap_base.h:1038
typename std::allocator< T > Allocator
Definition phmap_base.h:70
typename std::underlying_type< T >::type underlying_type_t
Definition phmap_base.h:329
typename std::aligned_storage< Len, Align >::type aligned_storage_t
Definition phmap_base.h:313
typename std::remove_cv< T >::type remove_cv_t
Definition phmap_base.h:267
std::shared_ptr< T > ShareUniquePtr(std::unique_ptr< T, D > &&ptr)
Definition phmap_base.h:1204
constexpr auto operator<=(const optional< T > &x, const optional< U > &y) -> decltype(optional_internal::convertible_to_bool(*x<= *y))
Definition phmap_base.h:2568
typename type_traits_internal::VoidTImpl< Ts... >::type void_t
Definition btree.h:134
T exchange(T &obj, U &&new_value)
Definition phmap_base.h:1127
constexpr Span< T > MakeSpan(T *ptr, size_t size) noexcept
Definition phmap_base.h:3617
typename std::common_type< T... >::type common_type_t
Definition phmap_base.h:326
typename std::add_const< T >::type add_const_t
Definition phmap_base.h:279
std::unique_ptr< T > WrapUnique(T *ptr)
Definition phmap_base.h:1148
typename std::remove_extent< T >::type remove_extent_t
Definition phmap_base.h:306
constexpr Span< const T > MakeConstSpan(T *ptr, size_t size) noexcept
Definition phmap_base.h:3662
typename std::pair< T1, T2 > Pair
Definition phmap_base.h:72
typename std::add_pointer< T >::type add_pointer_t
Definition phmap_base.h:297
void swap(btree_set< K, C, A > &x, btree_set< K, C, A > &y)
Definition btree.h:3882
constexpr nullopt_t nullopt(nullopt_t::init)
memory_internal::MakeUniqueResult< T >::scalar make_unique(Args &&... args)
Definition phmap_base.h:1179
typename utility_internal::Gen< T, N >::type make_integer_sequence
Definition phmap_base.h:958
make_index_sequence< sizeof...(Ts)> index_sequence_for
Definition phmap_base.h:974
constexpr phmap::remove_reference_t< T > && move(T &&t) noexcept
Definition phmap_base.h:1029
typename std::remove_pointer< T >::type remove_pointer_t
Definition phmap_base.h:294
std::weak_ptr< T > WeakenPtr(const std::shared_ptr< T > &ptr)
Definition phmap_base.h:1209
typename std::make_signed< T >::type make_signed_t
Definition phmap_base.h:300
typename std::enable_if< B, T >::type enable_if_t
Definition phmap_base.h:319
typename std::add_rvalue_reference< T >::type add_rvalue_reference_t
Definition phmap_base.h:291
typename std::add_lvalue_reference< T >::type add_lvalue_reference_t
Definition phmap_base.h:288
constexpr auto operator!=(const optional< T > &x, const optional< U > &y) -> decltype(optional_internal::convertible_to_bool(*x != *y))
Definition phmap_base.h:2547
constexpr optional< typename std::decay< T >::type > make_optional(T &&v)
Definition phmap_base.h:2505
constexpr auto operator==(const optional< T > &x, const optional< U > &y) -> decltype(optional_internal::convertible_to_bool(*x== *y))
Definition phmap_base.h:2536
typename std::result_of< F(ArgTypes...)>::type invoke_result_t
Definition phmap_base.h:335
typename std::remove_all_extents< T >::type remove_all_extents_t
Definition phmap_base.h:309
typename std::make_unsigned< T >::type make_unsigned_t
Definition phmap_base.h:303
typename std::conditional< B, T, F >::type conditional_t
Definition phmap_base.h:322
constexpr auto operator>(const optional< T > &x, const optional< U > &y) -> decltype(optional_internal::convertible_to_bool(*x > *y))
Definition phmap_base.h:2562
constexpr auto operator<(const optional< T > &x, const optional< U > &y) -> decltype(optional_internal::convertible_to_bool(*x< *y))
Definition phmap_base.h:2556
make_integer_sequence< size_t, N > make_index_sequence
Definition phmap_base.h:966
constexpr auto operator>=(const optional< T > &x, const optional< U > &y) -> decltype(optional_internal::convertible_to_bool(*x >= *y))
Definition phmap_base.h:2574
typename std::remove_reference< T >::type remove_reference_t
Definition phmap_base.h:285
typename std::add_cv< T >::type add_cv_t
Definition phmap_base.h:276
#define PHMAP_INTERNAL_INLINE_CONSTEXPR(var_type, name, init)
Definition phmap_base.h:631
#define PHMAP_INTERNAL_COMPRESSED_TUPLE_DECLSPEC
Definition phmap_base.h:4169
#define PHMAP_NO_THREAD_SAFETY_ANALYSIS
Definition phmap_base.h:4478
#define PHMAP_PREDICT_TRUE(x)
Definition phmap_bits.h:252
#define PHMAP_ASSERT(expr)
Definition phmap_config.h:773
#define PHMAP_INTERNAL_CATCH_ANY
Definition phmap_config.h:780
#define PHMAP_INTERNAL_TRY
Definition phmap_config.h:779
#define PHMAP_ATTRIBUTE_REINITIALIZES
Definition phmap_config.h:604
#define PHMAP_INTERNAL_RETHROW
Definition phmap_config.h:781
#define true
Definition stdbool.h:30
#define false
Definition stdbool.h:33
unsigned char bool
Definition stdbool.h:25
Definition phmap_base.h:76
bool operator()(const T &a, const T &b) const
Definition phmap_base.h:77
Definition phmap_base.h:85
bool operator()(const T &a, const T &b) const
Definition phmap_base.h:86
Definition phmap_base.h:4785
DoNothing(T &&)
Definition phmap_base.h:4793
void swap(DoNothing &)
Definition phmap_base.h:4796
DoNothing(mutex_type &, mutex_type &) noexcept
Definition phmap_base.h:4789
DoNothing(mutex_type &) noexcept
Definition phmap_base.h:4788
DoNothing(mutex_type &, phmap::defer_lock_t) noexcept
Definition phmap_base.h:4791
DoNothing() noexcept
Definition phmap_base.h:4787
DoNothing(mutex_type &, phmap::adopt_lock_t) noexcept
Definition phmap_base.h:4790
DoNothing(mutex_type &, phmap::try_to_lock_t)
Definition phmap_base.h:4792
DoNothing & operator=(DoNothing &&)
Definition phmap_base.h:4795
MutexType mutex_type
Definition phmap_base.h:4786
bool owns_lock() const noexcept
Definition phmap_base.h:4797
DoNothing & operator=(const DoNothing &)
Definition phmap_base.h:4794
Definition phmap_base.h:4754
Definition phmap_base.h:1599
Definition phmap_base.h:1379
typename memory_internal::RebindAlloc< Alloc, T >::type rebind_alloc
Definition phmap_base.h:1457
typename Alloc::value_type value_type
Definition phmap_base.h:1384
static size_type max_size(const Alloc &a)
Definition phmap_base.h:1506
static auto max_size_impl(int, const A &a) -> decltype(a.max_size())
Definition phmap_base.h:1550
static auto destroy_impl(int, A &a, T *p) -> decltype(std::allocator_traits< A >::destroy(a, p))
Definition phmap_base.h:1540
memory_internal::ExtractOrT< memory_internal::GetVoidPointer, Alloc, typename phmap::pointer_traits< pointer >::template rebind< void > > void_pointer
Definition phmap_base.h:1402
static void construct(Alloc &a, T *p, Args &&... args)
Definition phmap_base.h:1491
memory_internal::ExtractOrT< memory_internal::GetPropagateOnContainerCopyAssignment, Alloc, std::false_type > propagate_on_container_copy_assignment
Definition phmap_base.h:1430
static void construct_impl(char, Alloc &, T *p, Args &&... args)
Definition phmap_base.h:1535
memory_internal::ExtractOrT< memory_internal::GetPropagateOnContainerMoveAssignment, Alloc, std::false_type > propagate_on_container_move_assignment
Definition phmap_base.h:1437
memory_internal::ExtractOrT< memory_internal::GetSizeType, Alloc, typename std::make_unsigned< difference_type >::type > size_type
Definition phmap_base.h:1423
static auto allocate_impl(int, A &a, size_type n, const_void_pointer hint) -> decltype(a.allocate(n, hint))
Definition phmap_base.h:1517
static auto construct_impl(int, A &a, Args &&... args) -> decltype(std::allocator_traits< A >::construct(a, std::forward< Args >(args)...))
Definition phmap_base.h:1528
static void destroy_impl(char, Alloc &, T *p)
Definition phmap_base.h:1545
memory_internal::ExtractOrT< memory_internal::GetDifferenceType, Alloc, typename phmap::pointer_traits< pointer >::difference_type > difference_type
Definition phmap_base.h:1416
static size_type max_size_impl(char, const Alloc &)
Definition phmap_base.h:1553
memory_internal::ExtractOrT< memory_internal::GetPropagateOnContainerSwap, Alloc, std::false_type > propagate_on_container_swap
Definition phmap_base.h:1443
memory_internal::ExtractOrT< memory_internal::GetConstVoidPointer, Alloc, typename phmap::pointer_traits< pointer >::template rebind< const void > > const_void_pointer
Definition phmap_base.h:1409
static void destroy(Alloc &a, T *p)
Definition phmap_base.h:1499
static pointer allocate_impl(char, Alloc &a, size_type n, const_void_pointer)
Definition phmap_base.h:1522
static Alloc select_on_container_copy_construction_impl(char, const Alloc &a)
Definition phmap_base.h:1562
Alloc allocator_type
Definition phmap_base.h:1380
static auto select_on_container_copy_construction_impl(int, const A &a) -> decltype(a.select_on_container_copy_construction())
Definition phmap_base.h:1558
static pointer allocate(Alloc &a, size_type n, const_void_pointer hint)
Definition phmap_base.h:1474
static void deallocate(Alloc &a, pointer p, size_type n)
Definition phmap_base.h:1481
static Alloc select_on_container_copy_construction(const Alloc &a)
Definition phmap_base.h:1511
memory_internal::ExtractOrT< memory_internal::GetIsAlwaysEqual, Alloc, typename std::is_empty< Alloc >::type > is_always_equal
Definition phmap_base.h:1449
memory_internal::ExtractOrT< memory_internal::GetConstPointer, Alloc, typename phmap::pointer_traits< pointer >:: template rebind< const value_type > > const_pointer
Definition phmap_base.h:1394
static pointer allocate(Alloc &a, size_type n)
Definition phmap_base.h:1466
memory_internal::ExtractOrT< memory_internal::GetPointer, Alloc, value_type * > pointer
Definition phmap_base.h:1388
Definition phmap_base.h:840
static decltype(std::declval< F >()(std::declval< Args >()...)) Invoke(F &&f, Args &&... args)
Definition phmap_base.h:844
Definition phmap_base.h:825
Definition phmap_base.h:823
static decltype((*std::declval< Ptr >()).*std::declval< DataMem >()) Invoke(DataMem &&data_mem, Ptr &&ptr)
Definition phmap_base.h:832
Definition phmap_base.h:808
Definition phmap_base.h:806
static decltype(std::declval< Ref >().*std::declval< DataMem >()) Invoke(DataMem &&data_mem, Ref &&ref)
Definition phmap_base.h:814
Definition phmap_base.h:853
std::conditional< MemFunAndRef::Accept< Args... >::value, MemFunAndRef, typenamestd::conditional< MemFunAndPtr::Accept< Args... >::value, MemFunAndPtr, typenamestd::conditional< DataMemAndRef::Accept< Args... >::value, DataMemAndRef, typenamestd::conditional< DataMemAndPtr::Accept< Args... >::value, DataMemAndPtr, Callable >::type >::type >::type >::type type
Definition phmap_base.h:862
Definition phmap_base.h:781
Definition phmap_base.h:779
static decltype(((*std::declval< Ptr >()).*std::declval< MemFun >())(std::declval< Args >()...)) Invoke(MemFun &&mem_fun, Ptr &&ptr, Args &&... args)
Definition phmap_base.h:796
Definition phmap_base.h:755
Definition phmap_base.h:753
static decltype((std::declval< Obj >().*std::declval< MemFun >())(std::declval< Args >()...)) Invoke(MemFun &&mem_fun, Obj &&obj, Args &&... args)
Definition phmap_base.h:770
Definition phmap_base.h:746
Definition phmap_base.h:743
Definition phmap_base.h:200
Definition phmap_base.h:1606
Definition phmap_base.h:4755
Definition phmap_base.h:224
Definition phmap_base.h:1019
Definition phmap_base.h:990
Definition phmap_base.h:1006
Definition phmap_base.h:906
static constexpr size_t size() noexcept
Definition phmap_base.h:908
T value_type
Definition phmap_base.h:907
Definition phmap_base.h:596
T type
Definition phmap_base.h:597
Definition phmap_base.h:163
Definition phmap_base.h:168
Definition phmap_base.h:260
Definition phmap_base.h:254
Definition phmap_base.h:248
Definition phmap_base.h:242
typename T::element_type type
Definition phmap_base.h:1278
Definition phmap_base.h:1272
typename GetFirstArg< Ptr >::type type
Definition phmap_base.h:1273
T type
Definition phmap_base.h:1268
Definition phmap_base.h:1264
std::unique_ptr< T[]> array
Definition phmap_base.h:1164
void invalid
Definition phmap_base.h:1168
Definition phmap_base.h:1159
std::unique_ptr< T > scalar
Definition phmap_base.h:1160
typename std::allocator_traits< A >::template rebind_alloc< U > type
Definition phmap_base.h:1317
Definition phmap_base.h:1311
typename RebindFirstArg< T, U >::type type
Definition phmap_base.h:1312
Class< U, Args... > type
Definition phmap_base.h:1287
Definition phmap_base.h:1282
typename T::template rebind< U > type
Definition phmap_base.h:1297
Definition phmap_base.h:1291
typename RebindFirstArg< T, U >::type type
Definition phmap_base.h:1292
Definition phmap_base.h:237
Definition phmap_base.h:1697
Definition phmap_base.h:1696
constexpr nullopt_t(init_t &)
Definition phmap_base.h:1700
static init_t init
Definition phmap_base.h:1698
Definition phmap_base.h:1711
Definition phmap_base.h:2009
Definition phmap_base.h:1999
Definition phmap_base.h:1719
size_t result_type
Definition phmap_base.h:2034
size_t operator()(const phmap::optional< T > &opt) const
Definition phmap_base.h:2035
Definition phmap_base.h:2021
optional_hash_base & operator=(optional_hash_base &&)=delete
optional_hash_base(optional_hash_base &&)=delete
optional_hash_base & operator=(const optional_hash_base &)=delete
optional_hash_base(const optional_hash_base &)=delete
optional_hash_base()=delete
U * rebind
Definition phmap_base.h:1361
static pointer pointer_to(element_type &r) noexcept
Definition phmap_base.h:1365
T * pointer
Definition phmap_base.h:1356
T element_type
Definition phmap_base.h:1357
std::ptrdiff_t difference_type
Definition phmap_base.h:1358
Definition phmap_base.h:1325
typename memory_internal::RebindPtr< Ptr, U >::type rebind
Definition phmap_base.h:1343
typename memory_internal::ElementType< Ptr >::type element_type
Definition phmap_base.h:1331
Ptr pointer
Definition phmap_base.h:1326
memory_internal::ExtractOrT< memory_internal::GetDifferenceType, Ptr, std::ptrdiff_t > difference_type
Definition phmap_base.h:1335
static pointer pointer_to(element_type &r)
Definition phmap_base.h:1347
Definition phmap_base.h:3696
Definition phmap_base.h:2883
static T Transfer(Args &&... args)
Definition phmap_base.h:2905
static T Move(Args &&... args)
Definition phmap_base.h:2910
static void Reset(Node *node)
Definition phmap_base.h:2895
static auto GetSlot(const Node &node) -> decltype(node.slot())
Definition phmap_base.h:2885
static T Make(Args &&... args)
Definition phmap_base.h:2900
static void Destroy(Node *node)
Definition phmap_base.h:2890
Definition phmap_base.h:2918
Iterator position
Definition phmap_base.h:2919
bool inserted
Definition phmap_base.h:2920
NodeType node
Definition phmap_base.h:2921
Definition phmap_base.h:2716
key_type type
Definition phmap_base.h:2734
Definition phmap_base.h:2723
K type
Definition phmap_base.h:2726
Definition phmap_base.h:440
Definition phmap_base.h:428
Key operator()(Key &&k, const Args &...) const
Definition phmap_base.h:434
Definition phmap_base.h:425
typename std::remove_reference< reference >::type value_type
Definition phmap_base.h:460
typename std::remove_reference< reference >::type * pointer
Definition phmap_base.h:459
static auto key(slot_type *slot) -> decltype(P::apply(ReturnKey(), element(slot)))
Definition phmap_base.h:554
static size_t space_used(const slot_type *slot)
Definition phmap_base.h:512
static void transfer(Alloc *alloc, slot_type *new_slot, slot_type *old_slot)
Definition phmap_base.h:494
static auto element(slot_type *slot) -> decltype(P::element(slot))
Definition phmap_base.h:501
typename Policy::init_type init_type
Definition phmap_base.h:456
static void construct(Alloc *alloc, slot_type *slot, Args &&... args)
Definition phmap_base.h:471
static auto apply(F &&f, Ts &&... ts) -> decltype(P::apply(std::forward< F >(f), std::forward< Ts >(ts)...))
Definition phmap_base.h:546
decltype(Policy::element(std::declval< slot_type * >())) reference
Definition phmap_base.h:458
static void destroy(Alloc *alloc, slot_type *slot)
Definition phmap_base.h:478
typename Policy::slot_type slot_type
Definition phmap_base.h:448
typename Policy::key_type key_type
Definition phmap_base.h:451
static auto value(T *elem) -> decltype(P::value(elem))
Definition phmap_base.h:562
static void transfer_impl(Alloc *alloc, slot_type *new_slot, slot_type *old_slot, char)
Definition phmap_base.h:577
static auto transfer_impl(Alloc *alloc, slot_type *new_slot, slot_type *old_slot, int) -> decltype((void) P::transfer(alloc, new_slot, old_slot))
Definition phmap_base.h:570
constexpr CompressedTupleImpl()=default
constexpr CompressedTupleImpl(Ts &&... args)
Definition phmap_base.h:4258
Definition phmap_base.h:4181
T & get() &
Definition phmap_base.h:4239
constexpr const T & get() const &
Definition phmap_base.h:4238
constexpr Storage(T &&v)
Definition phmap_base.h:4237
T && get() &&
Definition phmap_base.h:4241
constexpr const T && get() const &&
Definition phmap_base.h:4240
constexpr Storage()=default
internal_compressed_tuple::ElemT< D, I > T
Definition phmap_base.h:4235
Definition phmap_base.h:4220
T & get() &
Definition phmap_base.h:4226
constexpr const T & get() const &
Definition phmap_base.h:4225
T value
Definition phmap_base.h:4222
constexpr Storage(T &&v)
Definition phmap_base.h:4224
constexpr const T && get() const &&
Definition phmap_base.h:4227
constexpr Storage()=default
ElemT< D, I > T
Definition phmap_base.h:4221
T && get() &&
Definition phmap_base.h:4228
Definition phmap_base.h:3732
static constexpr size_t value
Definition phmap_base.h:3733
Definition phmap_base.h:3701
Definition phmap_base.h:3725
T type
Definition phmap_base.h:3721
Definition phmap_base.h:3715
T type
Definition phmap_base.h:3716
Definition phmap_base.h:4634
static value_type & element(slot_type *slot)
Definition phmap_base.h:4651
static void destroy(Allocator *alloc, slot_type *slot)
Definition phmap_base.h:4686
static void move(Allocator *alloc, slot_type *src, slot_type *dest)
Definition phmap_base.h:4725
static void emplace(slot_type *slot)
Definition phmap_base.h:4640
static const K & key(const slot_type *slot)
Definition phmap_base.h:4656
static void transfer(Allocator *alloc, slot_type *new_slot, slot_type *old_slot)
Definition phmap_base.h:4695
static void construct(Allocator *alloc, slot_type *slot, slot_type *other)
Definition phmap_base.h:4674
static const value_type & element(const slot_type *slot)
Definition phmap_base.h:4652
static void construct(Allocator *alloc, slot_type *slot, Args &&... args)
Definition phmap_base.h:4661
std::pair< const K, V > value_type
Definition phmap_base.h:4636
std::pair< K, V > mutable_value_type
Definition phmap_base.h:4637
static void swap(Allocator *alloc, slot_type *a, slot_type *b)
Definition phmap_base.h:4709
static void move(Allocator *alloc, slot_type *first, slot_type *last, slot_type *result)
Definition phmap_base.h:4736
Definition phmap_base.h:4560
K first
Definition phmap_base.h:4561
V second
Definition phmap_base.h:4562
Definition phmap_base.h:4558
static constexpr bool LayoutCompatible()
Definition phmap_base.h:4567
Definition phmap_base.h:4543
Definition phmap_base.h:2787
Definition phmap_base.h:2781
T type
Definition phmap_base.h:2988
Definition phmap_base.h:2982
typename phmap::remove_reference_t< C >::value_type type
Definition phmap_base.h:2983
Definition phmap_base.h:3015
decltype(testval(std::declval< From >())) type
Definition phmap_base.h:3019
static std::true_type testval(To)
static std::false_type testval(...)
Definition phmap_base.h:3023
Definition phmap_base.h:4756
Definition phmap_base.h:370
Definition phmap_base.h:367
static void Sink(...)
Definition phmap_base.h:369
static NAT GetReturnType(...)
static auto GetReturnType(int) -> decltype(std::declval< std::hash< Key > >()(std::declval< Key const & >()))
friend void AssertHashEnabled()
Definition phmap_base.h:405
static std::nullptr_t DoIt()
Definition phmap_base.h:379
Definition phmap_base.h:357
Definition phmap_base.h:95
void type
Definition phmap_base.h:96
Definition phmap_base.h:104
std::true_type type
Definition phmap_base.h:145
Definition phmap_base.h:137
std::false_type type
Definition phmap_base.h:138
Definition phmap_base.h:150
std::true_type type
Definition phmap_base.h:130
Definition phmap_base.h:124
std::false_type type
Definition phmap_base.h:125
Definition phmap_base.h:134
Definition phmap_base.h:922
Definition phmap_base.h:938
typename Extend< typename Gen< T, N/2 >::type, N/2, N % 2 >::type type
Definition phmap_base.h:939
Definition phmap_base.h:4616
map_slot_type()
Definition phmap_base.h:4617
std::pair< const K, V > value_type
Definition phmap_base.h:4622
value_type value
Definition phmap_base.h:4625
map_slot_type(const map_slot_type &)=delete
K key
Definition phmap_base.h:4627
map_slot_type & operator=(const map_slot_type &)=delete
std::pair< K, V > mutable_value_type
Definition phmap_base.h:4623
mutable_value_type mutable_value
Definition phmap_base.h:4626