Revert "Update aosp/master libcxx rebase to r263688"
The world is burning.
This reverts commit c004fd909c006eec55077c52ee119e1fa338c9e9, reversing
changes made to 1418e4163da4bb0b9e3fe496e51c23a0dce399d9.
diff --git a/include/__hash_table b/include/__hash_table
index 8f6fc4d..dac4cfd 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -17,7 +17,6 @@
#include <iterator>
#include <algorithm>
#include <cmath>
-#include <utility>
#include <__undef_min_max>
#include <__undef___deallocate>
@@ -30,29 +29,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Key, class _Tp>
-union __hash_value_type;
-#else
-template <class _Key, class _Tp>
-struct __hash_value_type;
-#endif
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Tp>
-struct __is_hash_value_type_imp : false_type {};
-
-template <class _Key, class _Value>
-struct __is_hash_value_type_imp<__hash_value_type<_Key, _Value>> : true_type {};
-
-template <class ..._Args>
-struct __is_hash_value_type : false_type {};
-
-template <class _One>
-struct __is_hash_value_type<_One> : __is_hash_value_type_imp<typename __uncvref<_One>::type> {};
-#endif
-
_LIBCPP_FUNC_VIS
size_t __next_prime(size_t __n);
@@ -70,13 +46,18 @@
struct __hash_node
: public __hash_node_base
<
- typename __rebind_pointer<_VoidPtr, __hash_node<_Tp, _VoidPtr> >::type
+ typename pointer_traits<_VoidPtr>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<__hash_node<_Tp, _VoidPtr> >
+#else
+ rebind<__hash_node<_Tp, _VoidPtr> >::other
+#endif
>
{
- typedef _Tp __node_value_type;
+ typedef _Tp value_type;
size_t __hash_;
- __node_value_type __value_;
+ value_type __value_;
};
inline _LIBCPP_INLINE_VISIBILITY
@@ -100,175 +81,32 @@
return size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1));
}
-
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
-
-template <class _NodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_iterator;
template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
-template <class _NodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator;
-template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
class _LIBCPP_TYPE_VIS_ONLY unordered_map;
-template <class _Tp>
-struct __hash_key_value_types {
- static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, "");
- typedef _Tp key_type;
- typedef _Tp __node_value_type;
- typedef _Tp __container_value_type;
- static const bool __is_map = false;
-
- _LIBCPP_INLINE_VISIBILITY
- static key_type const& __get_key(_Tp const& __v) {
- return __v;
- }
- _LIBCPP_INLINE_VISIBILITY
- static __container_value_type const& __get_value(__node_value_type const& __v) {
- return __v;
- }
- _LIBCPP_INLINE_VISIBILITY
- static __container_value_type* __get_ptr(__node_value_type& __n) {
- return _VSTD::addressof(__n);
- }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
- static __container_value_type&& __move(__node_value_type& __v) {
- return _VSTD::move(__v);
- }
-#endif
-};
-
-template <class _Key, class _Tp>
-struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
- typedef _Key key_type;
- typedef _Tp mapped_type;
- typedef __hash_value_type<_Key, _Tp> __node_value_type;
- typedef pair<const _Key, _Tp> __container_value_type;
- typedef pair<_Key, _Tp> __nc_value_type;
- typedef __container_value_type __map_value_type;
- static const bool __is_map = true;
-
- _LIBCPP_INLINE_VISIBILITY
- static key_type const& __get_key(__container_value_type const& __v) {
- return __v.first;
- }
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- static typename enable_if<__is_same_uncvref<_Up, __node_value_type>::value,
- __container_value_type const&>::type
- __get_value(_Up& __t) {
- return __t.__cc;
- }
-
- template <class _Up>
- _LIBCPP_INLINE_VISIBILITY
- static typename enable_if<__is_same_uncvref<_Up, __container_value_type>::value,
- __container_value_type const&>::type
- __get_value(_Up& __t) {
- return __t;
- }
-
- _LIBCPP_INLINE_VISIBILITY
- static __container_value_type* __get_ptr(__node_value_type& __n) {
- return _VSTD::addressof(__n.__cc);
- }
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
- static __nc_value_type&& __move(__node_value_type& __v) {
- return _VSTD::move(__v.__nc);
- }
-#endif
-
-};
-
-template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,
- bool = _KVTypes::__is_map>
-struct __hash_map_pointer_types {};
-
-template <class _Tp, class _AllocPtr, class _KVTypes>
-struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
- typedef typename _KVTypes::__map_value_type _Mv;
- typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
- __map_value_type_pointer;
- typedef typename __rebind_pointer<_AllocPtr, const _Mv>::type
- __const_map_value_type_pointer;
-};
-
-template <class _NodePtr, class _NodeT = typename pointer_traits<_NodePtr>::element_type>
-struct __hash_node_types;
-
-template <class _NodePtr, class _Tp, class _VoidPtr>
-struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> >
- : public __hash_key_value_types<_Tp>, __hash_map_pointer_types<_Tp, _VoidPtr>
-
-{
- typedef __hash_key_value_types<_Tp> __base;
-
-public:
- typedef ptrdiff_t difference_type;
- typedef size_t size_type;
-
- typedef typename __rebind_pointer<_NodePtr, void>::type __void_pointer;
-
- typedef typename pointer_traits<_NodePtr>::element_type __node_type;
- typedef _NodePtr __node_pointer;
-
- typedef __hash_node_base<__node_pointer> __node_base_type;
- typedef typename __rebind_pointer<_NodePtr, __node_base_type>::type
- __node_base_pointer;
-
- typedef _Tp __node_value_type;
- typedef typename __rebind_pointer<_VoidPtr, __node_value_type>::type
- __node_value_type_pointer;
- typedef typename __rebind_pointer<_VoidPtr, const __node_value_type>::type
- __const_node_value_type_pointer;
-private:
- static_assert(!is_const<__node_type>::value,
- "_NodePtr should never be a pointer to const");
- static_assert((is_same<typename pointer_traits<_VoidPtr>::element_type, void>::value),
- "_VoidPtr does not point to unqualified void type");
- static_assert((is_same<typename __rebind_pointer<_VoidPtr, __node_type>::type,
- _NodePtr>::value), "_VoidPtr does not rebind to _NodePtr.");
-};
-
-
-
-template <class _HashIterator>
-struct __hash_node_types_from_iterator;
-template <class _NodePtr>
-struct __hash_node_types_from_iterator<__hash_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
-template <class _NodePtr>
-struct __hash_node_types_from_iterator<__hash_const_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
-template <class _NodePtr>
-struct __hash_node_types_from_iterator<__hash_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
-template <class _NodePtr>
-struct __hash_node_types_from_iterator<__hash_const_local_iterator<_NodePtr> > : __hash_node_types<_NodePtr> {};
-
-
-template <class _NodeValueTp, class _VoidPtr>
-struct __make_hash_node_types {
- typedef __hash_node<_NodeValueTp, _VoidPtr> _NodeTp;
- typedef typename __rebind_pointer<_VoidPtr, _NodeTp>::type _NodePtr;
- typedef __hash_node_types<_NodePtr> type;
-};
-
template <class _NodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_iterator
{
- typedef __hash_node_types<_NodePtr> _NodeTypes;
- typedef _NodePtr __node_pointer;
+ typedef _NodePtr __node_pointer;
__node_pointer __node_;
public:
- typedef forward_iterator_tag iterator_category;
- typedef typename _NodeTypes::__node_value_type value_type;
- typedef typename _NodeTypes::difference_type difference_type;
- typedef value_type& reference;
- typedef typename _NodeTypes::__node_value_type_pointer pointer;
+ typedef forward_iterator_tag iterator_category;
+ typedef typename pointer_traits<__node_pointer>::element_type::value_type value_type;
+ typedef typename pointer_traits<__node_pointer>::difference_type difference_type;
+ typedef value_type& reference;
+ typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<value_type>
+#else
+ rebind<value_type>::other
+#endif
+ pointer;
_LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
@@ -377,24 +215,37 @@
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
};
-template <class _NodePtr>
+template <class _ConstNodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator
{
- static_assert(!is_const<typename pointer_traits<_NodePtr>::element_type>::value, "");
- typedef __hash_node_types<_NodePtr> _NodeTypes;
- typedef _NodePtr __node_pointer;
+ typedef _ConstNodePtr __node_pointer;
- __node_pointer __node_;
+ __node_pointer __node_;
+
+ typedef typename remove_const<
+ typename pointer_traits<__node_pointer>::element_type
+ >::type __node;
public:
- typedef __hash_iterator<_NodePtr> __non_const_iterator;
-
- typedef forward_iterator_tag iterator_category;
- typedef typename _NodeTypes::__node_value_type value_type;
- typedef typename _NodeTypes::difference_type difference_type;
- typedef const value_type& reference;
- typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
-
+ typedef forward_iterator_tag iterator_category;
+ typedef typename __node::value_type value_type;
+ typedef typename pointer_traits<__node_pointer>::difference_type difference_type;
+ typedef const value_type& reference;
+ typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<const value_type>
+#else
+ rebind<const value_type>::other
+#endif
+ pointer;
+ typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<__node>
+#else
+ rebind<__node>::other
+#endif
+ __non_const_node_pointer;
+ typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator;
_LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
@@ -510,22 +361,30 @@
template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
};
+template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
+
template <class _NodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator
{
- typedef __hash_node_types<_NodePtr> _NodeTypes;
- typedef _NodePtr __node_pointer;
+ typedef _NodePtr __node_pointer;
__node_pointer __node_;
size_t __bucket_;
size_t __bucket_count_;
+ typedef pointer_traits<__node_pointer> __pointer_traits;
public:
typedef forward_iterator_tag iterator_category;
- typedef typename _NodeTypes::__node_value_type value_type;
- typedef typename _NodeTypes::difference_type difference_type;
+ typedef typename __pointer_traits::element_type::value_type value_type;
+ typedef typename __pointer_traits::difference_type difference_type;
typedef value_type& reference;
- typedef typename _NodeTypes::__node_value_type_pointer pointer;
+ typedef typename __pointer_traits::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<value_type>
+#else
+ rebind<value_type>::other
+#endif
+ pointer;
_LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT
{
@@ -648,8 +507,7 @@
template <class _ConstNodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator
{
- typedef __hash_node_types<_ConstNodePtr> _NodeTypes;
- typedef _ConstNodePtr __node_pointer;
+ typedef _ConstNodePtr __node_pointer;
__node_pointer __node_;
size_t __bucket_;
@@ -658,18 +516,29 @@
typedef pointer_traits<__node_pointer> __pointer_traits;
typedef typename __pointer_traits::element_type __node;
typedef typename remove_const<__node>::type __non_const_node;
- typedef typename __rebind_pointer<__node_pointer, __non_const_node>::type
- __non_const_node_pointer;
-public:
+ typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<__non_const_node>
+#else
+ rebind<__non_const_node>::other
+#endif
+ __non_const_node_pointer;
typedef __hash_local_iterator<__non_const_node_pointer>
__non_const_iterator;
-
- typedef forward_iterator_tag iterator_category;
- typedef typename _NodeTypes::__node_value_type value_type;
- typedef typename _NodeTypes::difference_type difference_type;
- typedef const value_type& reference;
- typedef typename _NodeTypes::__const_node_value_type_pointer pointer;
-
+public:
+ typedef forward_iterator_tag iterator_category;
+ typedef typename remove_const<
+ typename __pointer_traits::element_type::value_type
+ >::type value_type;
+ typedef typename __pointer_traits::difference_type difference_type;
+ typedef const value_type& reference;
+ typedef typename __pointer_traits::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<const value_type>
+#else
+ rebind<const value_type>::other
+#endif
+ pointer;
_LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT
{
@@ -856,11 +725,10 @@
{
typedef _Alloc allocator_type;
typedef allocator_traits<allocator_type> __alloc_traits;
-
+ typedef typename __alloc_traits::value_type::value_type value_type;
public:
typedef typename __alloc_traits::pointer pointer;
private:
- typedef __hash_node_types<pointer> _NodeTypes;
allocator_type& __na_;
@@ -880,7 +748,7 @@
void operator()(pointer __p) _NOEXCEPT
{
if (__value_constructed)
- __alloc_traits::destroy(__na_, _NodeTypes::__get_ptr(__p->__value_));
+ __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
if (__p)
__alloc_traits::deallocate(__na_, __p, 1);
}
@@ -899,47 +767,28 @@
private:
typedef allocator_traits<allocator_type> __alloc_traits;
- typedef typename
- __make_hash_node_types<value_type, typename __alloc_traits::void_pointer>::type
- _NodeTypes;
public:
-
- typedef typename _NodeTypes::__node_value_type __node_value_type;
- typedef typename _NodeTypes::__container_value_type __container_value_type;
- typedef typename _NodeTypes::key_type key_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
-#ifndef _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
typedef typename __alloc_traits::size_type size_type;
-#else
- typedef typename _NodeTypes::size_type size_type;
-#endif
- typedef typename _NodeTypes::difference_type difference_type;
+ typedef typename __alloc_traits::difference_type difference_type;
public:
// Create __node
-
- typedef typename _NodeTypes::__node_type __node;
+ typedef __hash_node<value_type, typename __alloc_traits::void_pointer> __node;
typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator;
typedef allocator_traits<__node_allocator> __node_traits;
- typedef typename _NodeTypes::__void_pointer __void_pointer;
- typedef typename _NodeTypes::__node_pointer __node_pointer;
- typedef typename _NodeTypes::__node_pointer __node_const_pointer;
- typedef typename _NodeTypes::__node_base_type __first_node;
- typedef typename _NodeTypes::__node_base_pointer __node_base_pointer;
-
-private:
- // check for sane allocator pointer rebinding semantics. Rebinding the
- // allocator for a new pointer type should be exactly the same as rebinding
- // the pointer using 'pointer_traits'.
- static_assert((is_same<__node_pointer, typename __node_traits::pointer>::value),
- "Allocator does not rebind pointers in a sane manner.");
- typedef typename __rebind_alloc_helper<__node_traits, __first_node>::type
- __node_base_allocator;
- typedef allocator_traits<__node_base_allocator> __node_base_traits;
- static_assert((is_same<__node_base_pointer, typename __node_base_traits::pointer>::value),
- "Allocator does not rebind pointers in a sane manner.");
+ typedef typename __node_traits::pointer __node_pointer;
+ typedef typename __node_traits::pointer __node_const_pointer;
+ typedef __hash_node_base<__node_pointer> __first_node;
+ typedef typename pointer_traits<__node_pointer>::template
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ rebind<__first_node>
+#else
+ rebind<__first_node>::other
+#endif
+ __node_base_pointer;
private:
@@ -950,10 +799,10 @@
typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;
// --- Member data begin ---
- __bucket_list __bucket_list_;
- __compressed_pair<__first_node, __node_allocator> __p1_;
- __compressed_pair<size_type, hasher> __p2_;
- __compressed_pair<float, key_equal> __p3_;
+ __bucket_list __bucket_list_;
+ __compressed_pair<__first_node, __node_allocator> __p1_;
+ __compressed_pair<size_type, hasher> __p2_;
+ __compressed_pair<float, key_equal> __p3_;
// --- Member data end ---
_LIBCPP_INLINE_VISIBILITY
@@ -989,7 +838,6 @@
typedef __hash_local_iterator<__node_pointer> local_iterator;
typedef __hash_const_local_iterator<__node_pointer> const_local_iterator;
- _LIBCPP_INLINE_VISIBILITY
__hash_table()
_NOEXCEPT_(
is_nothrow_default_constructible<__bucket_list>::value &&
@@ -997,14 +845,13 @@
is_nothrow_default_constructible<__node_allocator>::value &&
is_nothrow_default_constructible<hasher>::value &&
is_nothrow_default_constructible<key_equal>::value);
- _LIBCPP_INLINE_VISIBILITY
__hash_table(const hasher& __hf, const key_equal& __eql);
__hash_table(const hasher& __hf, const key_equal& __eql,
const allocator_type& __a);
explicit __hash_table(const allocator_type& __a);
__hash_table(const __hash_table& __u);
__hash_table(const __hash_table& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__hash_table(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_constructible<__bucket_list>::value &&
@@ -1013,12 +860,11 @@
is_nothrow_move_constructible<hasher>::value &&
is_nothrow_move_constructible<key_equal>::value);
__hash_table(__hash_table&& __u, const allocator_type& __a);
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
~__hash_table();
__hash_table& operator=(const __hash_table& __u);
-#ifndef _LIBCPP_CXX03_LANG
- _LIBCPP_INLINE_VISIBILITY
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__hash_table& operator=(__hash_table&& __u)
_NOEXCEPT_(
__node_traits::propagate_on_container_move_assignment::value &&
@@ -1043,103 +889,41 @@
iterator __node_insert_multi(const_iterator __p,
__node_pointer __nd);
-#ifndef _LIBCPP_CXX03_LANG
- template <class _Key, class ..._Args>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __emplace_unique_key_args(_Key const& __k, _Args&&... __args);
-
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class... _Args>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __emplace_unique_impl(_Args&&... __args);
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __emplace_unique(_Pp&& __x) {
- return __emplace_unique_extract_key(_VSTD::forward<_Pp>(__x),
- __can_extract_key<_Pp, key_type>());
- }
-
- template <class _First, class _Second>
- _LIBCPP_INLINE_VISIBILITY
- typename enable_if<
- __can_extract_map_key<_First, key_type, __container_value_type>::value,
- pair<iterator, bool>
- >::type __emplace_unique(_First&& __f, _Second&& __s) {
- return __emplace_unique_key_args(__f, _VSTD::forward<_First>(__f),
- _VSTD::forward<_Second>(__s));
- }
-
+ pair<iterator, bool> __emplace_unique(_Args&&... __args);
template <class... _Args>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __emplace_unique(_Args&&... __args) {
- return __emplace_unique_impl(_VSTD::forward<_Args>(__args)...);
- }
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool>
- __emplace_unique_extract_key(_Pp&& __x, __extract_key_fail_tag) {
- return __emplace_unique_impl(_VSTD::forward<_Pp>(__x));
- }
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool>
- __emplace_unique_extract_key(_Pp&& __x, __extract_key_self_tag) {
- return __emplace_unique_key_args(__x, _VSTD::forward<_Pp>(__x));
- }
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool>
- __emplace_unique_extract_key(_Pp&& __x, __extract_key_first_tag) {
- return __emplace_unique_key_args(__x.first, _VSTD::forward<_Pp>(__x));
- }
-
+ iterator __emplace_multi(_Args&&... __args);
template <class... _Args>
+ iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
+#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ template <class _ValueTp>
_LIBCPP_INLINE_VISIBILITY
- iterator __emplace_multi(_Args&&... __args);
- template <class... _Args>
+ pair<iterator, bool> __insert_unique_value(_ValueTp&& __x);
+#else
_LIBCPP_INLINE_VISIBILITY
- iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
-
-
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool>
- __insert_unique(__container_value_type&& __x) {
- return __emplace_unique_key_args(_NodeTypes::__get_key(__x), _VSTD::move(__x));
- }
-
- template <class _Pp, class = typename enable_if<
- !__is_same_uncvref<_Pp, __container_value_type>::value
- >::type>
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __insert_unique(_Pp&& __x) {
- return __emplace_unique(_VSTD::forward<_Pp>(__x));
- }
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- iterator __insert_multi(_Pp&& __x) {
- return __emplace_multi(_VSTD::forward<_Pp>(__x));
- }
-
- template <class _Pp>
- _LIBCPP_INLINE_VISIBILITY
- iterator __insert_multi(const_iterator __p, _Pp&& __x) {
- return __emplace_hint_multi(__p, _VSTD::forward<_Pp>(__x));
- }
-
-#else // !defined(_LIBCPP_CXX03_LANG)
- template <class _Key, class _Args>
- pair<iterator, bool> __emplace_unique_key_args(_Key const&, _Args& __args);
-
- iterator __insert_multi(const __container_value_type& __x);
- iterator __insert_multi(const_iterator __p, const __container_value_type& __x);
+ pair<iterator, bool> __insert_unique_value(const value_type& __x);
#endif
- _LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> __insert_unique(const __container_value_type& __x) {
- return __emplace_unique_key_args(_NodeTypes::__get_key(__x), __x);
- }
+ pair<iterator, bool> __insert_unique(const value_type& __x);
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ pair<iterator, bool> __insert_unique(value_type&& __x);
+ template <class _Pp>
+ pair<iterator, bool> __insert_unique(_Pp&& __x);
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ template <class _Pp>
+ iterator __insert_multi(_Pp&& __x);
+ template <class _Pp>
+ iterator __insert_multi(const_iterator __p, _Pp&& __x);
+#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ iterator __insert_multi(const value_type& __x);
+ iterator __insert_multi(const_iterator __p, const value_type& __x);
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
void clear() _NOEXCEPT;
void rehash(size_type __n);
@@ -1152,13 +936,9 @@
return __bucket_list_.get_deleter().size();
}
- _LIBCPP_INLINE_VISIBILITY
iterator begin() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
iterator end() _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
const_iterator begin() const _NOEXCEPT;
- _LIBCPP_INLINE_VISIBILITY
const_iterator end() const _NOEXCEPT;
template <class _Key>
@@ -1187,7 +967,6 @@
__node_holder remove(const_iterator __p) _NOEXCEPT;
template <class _Key>
- _LIBCPP_INLINE_VISIBILITY
size_type __count_unique(const _Key& __k) const;
template <class _Key>
size_type __count_multi(const _Key& __k) const;
@@ -1299,17 +1078,16 @@
private:
void __rehash(size_type __n);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class ..._Args>
- __node_holder __construct_node(_Args&& ...__args);
-
- template <class _First, class ..._Rest>
- __node_holder __construct_node_hash(size_t __hash, _First&& __f, _Rest&&... __rest);
-#else // _LIBCPP_CXX03_LANG
- __node_holder __construct_node(const __container_value_type& __v);
- __node_holder __construct_node_hash(size_t __hash, const __container_value_type& __v);
+ __node_holder __construct_node(_Args&& ...__args);
+#endif // _LIBCPP_HAS_NO_VARIADICS
+ __node_holder __construct_node(value_type&& __v, size_t __hash);
+#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ __node_holder __construct_node(const value_type& __v);
#endif
-
+ __node_holder __construct_node(const value_type& __v, size_t __hash);
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table& __u)
@@ -1319,7 +1097,6 @@
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __hash_table&, false_type) {}
-#ifndef _LIBCPP_CXX03_LANG
void __move_assign(__hash_table& __u, false_type);
void __move_assign(__hash_table& __u, true_type)
_NOEXCEPT_(
@@ -1346,7 +1123,6 @@
}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}
-#endif // _LIBCPP_CXX03_LANG
void __deallocate(__node_pointer __np) _NOEXCEPT;
__node_pointer __detach() _NOEXCEPT;
@@ -1356,12 +1132,11 @@
};
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
_NOEXCEPT_(
is_nothrow_default_constructible<__bucket_list>::value &&
is_nothrow_default_constructible<__first_node>::value &&
- is_nothrow_default_constructible<__node_allocator>::value &&
is_nothrow_default_constructible<hasher>::value &&
is_nothrow_default_constructible<key_equal>::value)
: __p2_(0),
@@ -1370,7 +1145,7 @@
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const hasher& __hf,
const key_equal& __eql)
: __bucket_list_(nullptr, __bucket_list_deleter()),
@@ -1423,14 +1198,13 @@
{
}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
_NOEXCEPT_(
is_nothrow_move_constructible<__bucket_list>::value &&
is_nothrow_move_constructible<__first_node>::value &&
- is_nothrow_move_constructible<__node_allocator>::value &&
is_nothrow_move_constructible<hasher>::value &&
is_nothrow_move_constructible<key_equal>::value)
: __bucket_list_(_VSTD::move(__u.__bucket_list_)),
@@ -1472,7 +1246,7 @@
}
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::~__hash_table()
@@ -1537,7 +1311,7 @@
}
__get_db()->unlock();
#endif
- __node_traits::destroy(__na, _NodeTypes::__get_ptr(__np->__value_));
+ __node_traits::destroy(__na, _VSTD::addressof(__np->__value_));
__node_traits::deallocate(__na, __np, 1);
__np = __next;
}
@@ -1556,7 +1330,7 @@
return __cache;
}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
@@ -1629,7 +1403,8 @@
const_iterator __i = __u.begin();
while (__u.size() != 0)
{
- __node_holder __h = __construct_node(_NodeTypes::__move(__u.remove(__i++)->__value_));
+ __node_holder __h =
+ __construct_node(_VSTD::move(__u.remove(__i++)->__value_));
__node_insert_multi(__h.get());
__h.release();
}
@@ -1637,7 +1412,7 @@
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
__hash_table<_Tp, _Hash, _Equal, _Alloc>&
__hash_table<_Tp, _Hash, _Equal, _Alloc>::operator=(__hash_table&& __u)
_NOEXCEPT_(
@@ -1651,7 +1426,7 @@
return *this;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _InputIterator>
@@ -1659,11 +1434,6 @@
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_unique(_InputIterator __first,
_InputIterator __last)
{
- typedef iterator_traits<_InputIterator> _ITraits;
- typedef typename _ITraits::value_type _ItValueType;
- static_assert((is_same<_ItValueType, __container_value_type>::value),
- "__assign_unique may only be called with the containers value type");
-
if (bucket_count() != 0)
{
__node_pointer __cache = __detach();
@@ -1698,12 +1468,6 @@
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__assign_multi(_InputIterator __first,
_InputIterator __last)
{
- typedef iterator_traits<_InputIterator> _ITraits;
- typedef typename _ITraits::value_type _ItValueType;
- static_assert((is_same<_ItValueType, __container_value_type>::value ||
- is_same<_ItValueType, __node_value_type>::value),
- "__assign_multi may only be called with the containers value type"
- " or the nodes value type");
if (bucket_count() != 0)
{
__node_pointer __cache = __detach();
@@ -1729,11 +1493,11 @@
__deallocate(__cache);
}
for (; __first != __last; ++__first)
- __insert_multi(_NodeTypes::__get_value(*__first));
+ __insert_multi(*__first);
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() _NOEXCEPT
{
@@ -1745,7 +1509,7 @@
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() _NOEXCEPT
{
@@ -1757,7 +1521,7 @@
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::begin() const _NOEXCEPT
{
@@ -1769,7 +1533,7 @@
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::const_iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::end() const _NOEXCEPT
{
@@ -1955,24 +1719,31 @@
return __node_insert_multi(__cp);
}
-
-
-#ifndef _LIBCPP_CXX03_LANG
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Key, class ..._Args>
+pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
+{
+ return __insert_unique_value(__x);
+}
+
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+template <class _Tp, class _Hash, class _Equal, class _Alloc>
+template <class _ValueTp>
_LIBCPP_INLINE_VISIBILITY
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args&&... __args)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(_ValueTp&& __x)
#else
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _Key, class _Args>
_LIBCPP_INLINE_VISIBILITY
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_key_args(_Key const& __k, _Args& __args)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type& __x)
#endif
{
-
- size_t __hash = hash_function()(__k);
+#if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+ typedef const value_type& _ValueTp;
+#endif
+ size_t __hash = hash_function()(__x);
size_type __bc = bucket_count();
bool __inserted = false;
__node_pointer __nd;
@@ -1987,17 +1758,13 @@
__constrain_hash(__nd->__hash_, __bc) == __chash;
__nd = __nd->__next_)
{
- if (key_eq()(__nd->__value_, __k))
+ if (key_eq()(__nd->__value_, __x))
goto __done;
}
}
}
{
-#ifndef _LIBCPP_CXX03_LANG
- __node_holder __h = __construct_node_hash(__hash, _VSTD::forward<_Args>(__args)...);
-#else
- __node_holder __h = __construct_node_hash(__hash, __args);
-#endif
+ __node_holder __h = __construct_node(_VSTD::forward<_ValueTp>(__x), __hash);
if (size()+1 > __bc * max_load_factor() || __bc == 0)
{
rehash(_VSTD::max<size_type>(2 * __bc + !__is_hash_power2(__bc),
@@ -2009,7 +1776,7 @@
__node_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(static_cast<__void_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
+ __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
__h->__next_ = __pn->__next_;
__pn->__next_ = __h.get();
// fix up __bucket_list_
@@ -2035,12 +1802,13 @@
#endif
}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique_impl(_Args&&... __args)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique(_Args&&... __args)
{
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
pair<iterator, bool> __r = __node_insert_unique(__h.get());
@@ -2077,11 +1845,64 @@
return __r;
}
-#else // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
+template <class _Tp, class _Hash, class _Equal, class _Alloc>
+pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(value_type&& __x)
+{
+ return __insert_unique_value(_VSTD::move(__x));
+}
+
+template <class _Tp, class _Hash, class _Equal, class _Alloc>
+template <class _Pp>
+pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_Pp&& __x)
+{
+ __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
+ pair<iterator, bool> __r = __node_insert_unique(__h.get());
+ if (__r.second)
+ __h.release();
+ return __r;
+}
+
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class _Tp, class _Hash, class _Equal, class _Alloc>
+template <class _Pp>
+typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(_Pp&& __x)
+{
+ __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
+ iterator __r = __node_insert_multi(__h.get());
+ __h.release();
+ return __r;
+}
+
+template <class _Tp, class _Hash, class _Equal, class _Alloc>
+template <class _Pp>
+typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
+ _Pp&& __x)
+{
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+ "unordered container::insert(const_iterator, rvalue) called with an iterator not"
+ " referring to this unordered container");
+#endif
+ __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
+ iterator __r = __node_insert_multi(__p, __h.get());
+ __h.release();
+ return __r;
+}
+
+#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const __container_value_type& __x)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const value_type& __x)
{
__node_holder __h = __construct_node(__x);
iterator __r = __node_insert_multi(__h.get());
@@ -2092,7 +1913,7 @@
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
- const __container_value_type& __x)
+ const value_type& __x)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
@@ -2105,7 +1926,7 @@
return __r;
}
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
@@ -2244,74 +2065,70 @@
return end();
}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class ..._Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
{
- static_assert(!__is_hash_value_type<_Args...>::value,
- "Construct cannot be called with a hash value type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), _VSTD::forward<_Args>(__args)...);
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_);
__h->__next_ = nullptr;
return __h;
}
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
template <class _Tp, class _Hash, class _Equal, class _Alloc>
-template <class _First, class ..._Rest>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(
- size_t __hash, _First&& __f, _Rest&& ...__rest)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
+ size_t __hash)
{
- static_assert(!__is_hash_value_type<_First, _Rest...>::value,
- "Construct cannot be called with a hash value type");
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_),
- _VSTD::forward<_First>(__f),
- _VSTD::forward<_Rest>(__rest)...);
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
return __h;
}
-#else // _LIBCPP_CXX03_LANG
+#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const __container_value_type& __v)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v)
{
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_);
__h->__next_ = nullptr;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
+ return _VSTD::move(__h); // explicitly moved for C++03
}
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
-__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node_hash(size_t __hash,
- const __container_value_type& __v)
+__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v,
+ size_t __hash)
{
__node_allocator& __na = __node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _NodeTypes::__get_ptr(__h->__value_), __v);
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
- return _LIBCPP_EXPLICIT_MOVE(__h); // explicitly moved for C++03
+ return _VSTD::move(__h); // explicitly moved for C++03
}
-#endif // _LIBCPP_CXX03_LANG
-
template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::erase(const_iterator __p)
@@ -2441,7 +2258,7 @@
template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Key>
-inline
+inline _LIBCPP_INLINE_VISIBILITY
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::size_type
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__count_unique(const _Key& __k) const
{