summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/unordered_map
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/unordered_map')
-rw-r--r--contrib/libc++/include/unordered_map311
1 files changed, 154 insertions, 157 deletions
diff --git a/contrib/libc++/include/unordered_map b/contrib/libc++/include/unordered_map
index 235b2ea..78e6307 100644
--- a/contrib/libc++/include/unordered_map
+++ b/contrib/libc++/include/unordered_map
@@ -325,7 +325,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Key, class _Tp, class _Hash, bool = is_empty<_Hash>::value
+template <class _Key, class _Cp, class _Hash, bool = is_empty<_Hash>::value
#if __has_feature(is_final)
&& !__is_final(_Hash)
#endif
@@ -333,8 +333,6 @@ template <class _Key, class _Tp, class _Hash, bool = is_empty<_Hash>::value
class __unordered_map_hasher
: private _Hash
{
- typedef pair<typename remove_const<_Key>::type, _Tp> _Pp;
- typedef pair<const _Key, _Tp> _Cp;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher()
@@ -347,23 +345,18 @@ public:
_LIBCPP_INLINE_VISIBILITY
const _Hash& hash_function() const _NOEXCEPT {return *this;}
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(const _Pp& __x) const
- {return static_cast<const _Hash&>(*this)(__x.first);}
- _LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Cp& __x) const
- {return static_cast<const _Hash&>(*this)(__x.first);}
+ {return static_cast<const _Hash&>(*this)(__x.__cc.first);}
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return static_cast<const _Hash&>(*this)(__x);}
};
-template <class _Key, class _Tp, class _Hash>
-class __unordered_map_hasher<_Key, _Tp, _Hash, false>
+template <class _Key, class _Cp, class _Hash>
+class __unordered_map_hasher<_Key, _Cp, _Hash, false>
{
_Hash __hash_;
- typedef pair<typename remove_const<_Key>::type, _Tp> _Pp;
- typedef pair<const _Key, _Tp> _Cp;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher()
@@ -376,17 +369,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
const _Hash& hash_function() const _NOEXCEPT {return __hash_;}
_LIBCPP_INLINE_VISIBILITY
- size_t operator()(const _Pp& __x) const
- {return __hash_(__x.first);}
- _LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Cp& __x) const
- {return __hash_(__x.first);}
+ {return __hash_(__x.__cc.first);}
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Key& __x) const
{return __hash_(__x);}
};
-template <class _Key, class _Tp, class _Pred, bool = is_empty<_Pred>::value
+template <class _Key, class _Cp, class _Pred, bool = is_empty<_Pred>::value
#if __has_feature(is_final)
&& !__is_final(_Pred)
#endif
@@ -394,8 +384,6 @@ template <class _Key, class _Tp, class _Pred, bool = is_empty<_Pred>::value
class __unordered_map_equal
: private _Pred
{
- typedef pair<typename remove_const<_Key>::type, _Tp> _Pp;
- typedef pair<const _Key, _Tp> _Cp;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal()
@@ -408,41 +396,21 @@ public:
_LIBCPP_INLINE_VISIBILITY
const _Pred& key_eq() const _NOEXCEPT {return *this;}
_LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Pp& __x, const _Pp& __y) const
- {return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Pp& __x, const _Cp& __y) const
- {return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Pp& __x, const _Key& __y) const
- {return static_cast<const _Pred&>(*this)(__x.first, __y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Cp& __x, const _Pp& __y) const
- {return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _Cp& __y) const
- {return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
+ {return static_cast<const _Pred&>(*this)(__x.__cc.first, __y.__cc.first);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _Key& __y) const
- {return static_cast<const _Pred&>(*this)(__x.first, __y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Key& __x, const _Pp& __y) const
- {return static_cast<const _Pred&>(*this)(__x, __y.first);}
+ {return static_cast<const _Pred&>(*this)(__x.__cc.first, __y);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
- {return static_cast<const _Pred&>(*this)(__x, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Key& __x, const _Key& __y) const
- {return static_cast<const _Pred&>(*this)(__x, __y);}
+ {return static_cast<const _Pred&>(*this)(__x, __y.__cc.first);}
};
-template <class _Key, class _Tp, class _Pred>
-class __unordered_map_equal<_Key, _Tp, _Pred, false>
+template <class _Key, class _Cp, class _Pred>
+class __unordered_map_equal<_Key, _Cp, _Pred, false>
{
_Pred __pred_;
- typedef pair<typename remove_const<_Key>::type, _Tp> _Pp;
- typedef pair<const _Key, _Tp> _Cp;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal()
@@ -455,32 +423,14 @@ public:
_LIBCPP_INLINE_VISIBILITY
const _Pred& key_eq() const _NOEXCEPT {return __pred_;}
_LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Pp& __x, const _Pp& __y) const
- {return __pred_(__x.first, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Pp& __x, const _Cp& __y) const
- {return __pred_(__x.first, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Pp& __x, const _Key& __y) const
- {return __pred_(__x.first, __y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Cp& __x, const _Pp& __y) const
- {return __pred_(__x.first, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _Cp& __y) const
- {return __pred_(__x.first, __y.first);}
+ {return __pred_(__x.__cc.first, __y.__cc.first);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Cp& __x, const _Key& __y) const
- {return __pred_(__x.first, __y);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Key& __x, const _Pp& __y) const
- {return __pred_(__x, __y.first);}
+ {return __pred_(__x.__cc.first, __y);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
- {return __pred_(__x, __y.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Key& __x, const _Key& __y) const
- {return __pred_(__x, __y);}
+ {return __pred_(__x, __y.__cc.first);}
};
template <class _Alloc>
@@ -492,8 +442,8 @@ class __hash_map_node_destructor
public:
typedef typename __alloc_traits::pointer pointer;
private:
- typedef typename value_type::first_type first_type;
- typedef typename value_type::second_type second_type;
+ typedef typename value_type::value_type::first_type first_type;
+ typedef typename value_type::value_type::second_type second_type;
allocator_type& __na_;
@@ -535,9 +485,9 @@ public:
void operator()(pointer __p) _NOEXCEPT
{
if (__second_constructed)
- __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
+ __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.second));
if (__first_constructed)
- __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
+ __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.first));
if (__p)
__alloc_traits::deallocate(__na_, __p, 1);
}
@@ -549,8 +499,8 @@ class _LIBCPP_TYPE_VIS __hash_map_iterator
_HashIterator __i_;
typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
- typedef const typename _HashIterator::value_type::first_type key_type;
- typedef typename _HashIterator::value_type::second_type mapped_type;
+ typedef const typename _HashIterator::value_type::value_type::first_type key_type;
+ typedef typename _HashIterator::value_type::value_type::second_type mapped_type;
public:
typedef forward_iterator_tag iterator_category;
typedef pair<key_type, mapped_type> value_type;
@@ -571,9 +521,9 @@ public:
__hash_map_iterator(_HashIterator __i) _NOEXCEPT : __i_(__i) {}
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const {return *operator->();}
+ reference operator*() const {return __i_->__cc;}
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const {return (pointer)__i_.operator->();}
+ pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);}
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator& operator++() {++__i_; return *this;}
@@ -605,8 +555,8 @@ class _LIBCPP_TYPE_VIS __hash_map_const_iterator
_HashIterator __i_;
typedef pointer_traits<typename _HashIterator::pointer> __pointer_traits;
- typedef const typename _HashIterator::value_type::first_type key_type;
- typedef typename _HashIterator::value_type::second_type mapped_type;
+ typedef const typename _HashIterator::value_type::value_type::first_type key_type;
+ typedef typename _HashIterator::value_type::value_type::second_type mapped_type;
public:
typedef forward_iterator_tag iterator_category;
typedef pair<key_type, mapped_type> value_type;
@@ -632,9 +582,9 @@ public:
: __i_(__i.__i_) {}
_LIBCPP_INLINE_VISIBILITY
- reference operator*() const {return *operator->();}
+ reference operator*() const {return __i_->__cc;}
_LIBCPP_INLINE_VISIBILITY
- pointer operator->() const {return (pointer)__i_.operator->();}
+ pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);}
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator& operator++() {++__i_; return *this;}
@@ -671,13 +621,56 @@ public:
typedef _Pred key_equal;
typedef _Alloc allocator_type;
typedef pair<const key_type, mapped_type> value_type;
+ typedef pair<key_type, mapped_type> __nc_value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
private:
- typedef pair<key_type, mapped_type> __value_type;
- typedef __unordered_map_hasher<key_type, mapped_type, hasher> __hasher;
- typedef __unordered_map_equal<key_type, mapped_type, key_equal> __key_equal;
+#if __cplusplus >= 201103L
+ union __value_type
+ {
+ typedef typename unordered_map::value_type value_type;
+ typedef typename unordered_map::__nc_value_type __nc_value_type;
+ value_type __cc;
+ __nc_value_type __nc;
+
+ template <class ..._Args>
+ __value_type(_Args&& ...__args)
+ : __cc(std::forward<_Args>(__args)...) {}
+
+ __value_type(const __value_type& __v)
+ : __cc(std::move(__v.__cc)) {}
+
+ __value_type(__value_type&& __v)
+ : __nc(std::move(__v.__nc)) {}
+
+ __value_type& operator=(const __value_type& __v)
+ {__nc = __v.__cc; return *this;}
+
+ __value_type& operator=(__value_type&& __v)
+ {__nc = std::move(__v.__nc); return *this;}
+
+ ~__value_type() {__cc.~value_type();}
+ };
+#else
+ struct __value_type
+ {
+ typedef typename unordered_map::value_type value_type;
+ value_type __cc;
+
+ __value_type() {}
+
+ template <class _A0>
+ __value_type(const _A0& __a0)
+ : __cc(__a0) {}
+
+ template <class _A0, class _A1>
+ __value_type(const _A0& __a0, const _A1& __a1)
+ : __cc(__a0, __a1) {}
+ };
+#endif
+ typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
+ typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
typedef typename allocator_traits<allocator_type>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
rebind_alloc<__value_type>
@@ -750,7 +743,16 @@ public:
_LIBCPP_INLINE_VISIBILITY
unordered_map& operator=(const unordered_map& __u)
{
+#if __cplusplus >= 201103L
__table_ = __u.__table_;
+#else
+ __table_.clear();
+ __table_.hash_function() = __u.__table_.hash_function();
+ __table_.key_eq() = __u.__table_.key_eq();
+ __table_.max_load_factor() = __u.__table_.max_load_factor();
+ __table_.__copy_assign_alloc(__u.__table_);
+ insert(__u.begin(), __u.end());
+#endif
return *this;
}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -907,26 +909,15 @@ private:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__node_holder __construct_node();
template <class _A0>
- typename enable_if
- <
- is_constructible<value_type, _A0>::value,
- __node_holder
- >::type
- __construct_node(_A0&& __a0);
- template <class _A0>
- typename enable_if
- <
- is_constructible<key_type, _A0>::value,
- __node_holder
- >::type
+ __node_holder
__construct_node(_A0&& __a0);
+ __node_holder __construct_node_with_key(key_type&& __k);
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _A0, class _A1, class ..._Args>
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
#endif // _LIBCPP_HAS_NO_VARIADICS
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
- __node_holder __construct_node(const key_type& __k);
-#endif
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+ __node_holder __construct_node_with_key(const key_type& __k);
};
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -1105,11 +1096,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node()
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _A0>
-typename enable_if
-<
- is_constructible<pair<const _Key, _Tp>, _A0>::value,
- typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
->::type
+typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
{
__node_allocator& __na = __table_.__node_alloc();
@@ -1122,22 +1109,16 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _A0>
-typename enable_if
-<
- is_constructible<_Key, _A0>::value,
- typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
->::type
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
+typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(key_type&& __k)
{
__node_allocator& __na = __table_.__node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
- _VSTD::forward<_A0>(__a0));
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), _VSTD::move(__k));
__h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return __h;
+ return _VSTD::move(__h);
}
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1172,23 +1153,21 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&&... __args)
}
#endif // _LIBCPP_HAS_NO_VARIADICS
-#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k)
{
__node_allocator& __na = __table_.__node_alloc();
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k);
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k);
__h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
+ __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
return _VSTD::move(__h);
}
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
@@ -1207,7 +1186,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
iterator __i = find(__k);
if (__i != end())
return __i->second;
- __node_holder __h = __construct_node(__k);
+ __node_holder __h = __construct_node_with_key(__k);
pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
__h.release();
return __r.first->second;
@@ -1222,7 +1201,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&& __k)
iterator __i = find(__k);
if (__i != end())
return __i->second;
- __node_holder __h = __construct_node(_VSTD::move(__k));
+ __node_holder __h = __construct_node_with_key(_VSTD::move(__k));
pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
__h.release();
return __r.first->second;
@@ -1304,13 +1283,56 @@ public:
typedef _Pred key_equal;
typedef _Alloc allocator_type;
typedef pair<const key_type, mapped_type> value_type;
+ typedef pair<key_type, mapped_type> __nc_value_type;
typedef value_type& reference;
typedef const value_type& const_reference;
private:
- typedef pair<key_type, mapped_type> __value_type;
- typedef __unordered_map_hasher<key_type, mapped_type, hasher> __hasher;
- typedef __unordered_map_equal<key_type, mapped_type, key_equal> __key_equal;
+#if __cplusplus >= 201103L
+ union __value_type
+ {
+ typedef typename unordered_multimap::value_type value_type;
+ typedef typename unordered_multimap::__nc_value_type __nc_value_type;
+ value_type __cc;
+ __nc_value_type __nc;
+
+ template <class ..._Args>
+ __value_type(_Args&& ...__args)
+ : __cc(std::forward<_Args>(__args)...) {}
+
+ __value_type(const __value_type& __v)
+ : __cc(std::move(__v.__cc)) {}
+
+ __value_type(__value_type&& __v)
+ : __nc(std::move(__v.__nc)) {}
+
+ __value_type& operator=(const __value_type& __v)
+ {__nc = __v.__cc; return *this;}
+
+ __value_type& operator=(__value_type&& __v)
+ {__nc = std::move(__v.__nc); return *this;}
+
+ ~__value_type() {__cc.~value_type();}
+ };
+#else
+ struct __value_type
+ {
+ typedef typename unordered_multimap::value_type value_type;
+ value_type __cc;
+
+ __value_type() {}
+
+ template <class _A0>
+ __value_type(const _A0& __a0)
+ : __cc(__a0) {}
+
+ template <class _A0, class _A1>
+ __value_type(const _A0& __a0, const _A1& __a1)
+ : __cc(__a0, __a1) {}
+ };
+#endif
+ typedef __unordered_map_hasher<key_type, __value_type, hasher> __hasher;
+ typedef __unordered_map_equal<key_type, __value_type, key_equal> __key_equal;
typedef typename allocator_traits<allocator_type>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
rebind_alloc<__value_type>
@@ -1382,7 +1404,16 @@ public:
_LIBCPP_INLINE_VISIBILITY
unordered_multimap& operator=(const unordered_multimap& __u)
{
+#if __cplusplus >= 201103L
__table_ = __u.__table_;
+#else
+ __table_.clear();
+ __table_.hash_function() = __u.__table_.hash_function();
+ __table_.key_eq() = __u.__table_.key_eq();
+ __table_.max_load_factor() = __u.__table_.max_load_factor();
+ __table_.__copy_assign_alloc(__u.__table_);
+ insert(__u.begin(), __u.end());
+#endif
return *this;
}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -1529,18 +1560,7 @@ private:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__node_holder __construct_node();
template <class _A0>
- typename enable_if
- <
- is_constructible<value_type, _A0>::value,
- __node_holder
- >::type
- __construct_node(_A0&& __a0);
- template <class _A0>
- typename enable_if
- <
- is_constructible<key_type, _A0>::value,
- __node_holder
- >::type
+ __node_holder
__construct_node(_A0&& __a0);
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _A0, class _A1, class ..._Args>
@@ -1727,11 +1747,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node()
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _A0>
-typename enable_if
-<
- is_constructible<pair<const _Key, _Tp>, _A0>::value,
- typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
->::type
+typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
{
__node_allocator& __na = __table_.__node_alloc();
@@ -1743,25 +1759,6 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0
return __h;
}
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-template <class _A0>
-typename enable_if
-<
- is_constructible<_Key, _A0>::value,
- typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
->::type
-unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
-{
- __node_allocator& __na = __table_.__node_alloc();
- __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
- _VSTD::forward<_A0>(__a0));
- __h.get_deleter().__first_constructed = true;
- __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
- __h.get_deleter().__second_constructed = true;
- return __h;
-}
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
OpenPOWER on IntegriCloud