Revert r260012 due to __gnu_cxx::hash_map breakage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@260172 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/unordered_map b/include/unordered_map
index a05c2b5..85a54a7 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -384,7 +384,6 @@
class __unordered_map_hasher
: private _Hash
{
- typedef typename __key_value_types<_Cp>::__map_value_type _PairT;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher()
@@ -415,7 +414,6 @@
{
_Hash __hash_;
- typedef typename __key_value_types<_Cp>::__map_value_type _PairT;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher()
@@ -457,7 +455,6 @@
class __unordered_map_equal
: private _Pred
{
- typedef typename __key_value_types<_Cp>::__map_value_type _PairT;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal()
@@ -491,7 +488,6 @@
{
_Pred __pred_;
- typedef typename __key_value_types<_Cp>::__map_value_type _PairT;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal()
@@ -512,9 +508,6 @@
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Key& __x, const _Cp& __y) const
{return __pred_(__x, __y.__cc.first);}
- _LIBCPP_INLINE_VISIBILITY
- bool operator()(const _Key& __x, const _PairT& __y) const
- {return __pred_(__x, __y.first);}
void swap(__unordered_map_equal&__y)
_NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
{
@@ -538,11 +531,12 @@
{
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;
+ typedef typename __alloc_traits::pointer pointer;
private:
+ typedef typename value_type::value_type::first_type first_type;
+ typedef typename value_type::value_type::second_type second_type;
allocator_type& __na_;
@@ -662,14 +656,15 @@
{
_HashIterator __i_;
- typedef __hash_node_types_from_iterator<_HashIterator> _NodeTypes;
-
+ 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 typename _NodeTypes::__map_value_type value_type;
- typedef typename _NodeTypes::difference_type difference_type;
+ typedef pair<key_type, mapped_type> value_type;
+ typedef typename _HashIterator::difference_type difference_type;
typedef value_type& reference;
- typedef typename _NodeTypes::__map_value_type_pointer pointer;
+ typedef typename __rebind_pointer<typename _HashIterator::pointer, value_type>::type
+ pointer;
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator() _NOEXCEPT {}
@@ -711,14 +706,15 @@
{
_HashIterator __i_;
- typedef __hash_node_types_from_iterator<_HashIterator> _NodeTypes;
-
+ 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 typename _NodeTypes::__map_value_type value_type;
- typedef typename _NodeTypes::difference_type difference_type;
+ typedef pair<key_type, mapped_type> value_type;
+ typedef typename _HashIterator::difference_type difference_type;
typedef const value_type& reference;
- typedef typename _NodeTypes::__const_map_value_type_pointer pointer;
+ typedef typename __rebind_pointer<typename _HashIterator::pointer, const value_type>::type
+ pointer;
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator() _NOEXCEPT {}
@@ -800,8 +796,8 @@
public:
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
- typedef typename __table::size_type size_type;
- typedef typename __table::difference_type difference_type;
+ typedef typename __alloc_traits::size_type size_type;
+ typedef typename __alloc_traits::difference_type difference_type;
typedef __hash_map_iterator<typename __table::iterator> iterator;
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
@@ -1645,14 +1641,11 @@
typedef __hash_map_node_destructor<__node_allocator> _Dp;
typedef unique_ptr<__node, _Dp> __node_holder;
typedef allocator_traits<allocator_type> __alloc_traits;
- static_assert((is_same<typename __node_traits::size_type,
- typename __alloc_traits::size_type>::value),
- "Allocator uses different size_type for different types");
public:
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
- typedef typename __table::size_type size_type;
- typedef typename __table::difference_type difference_type;
+ typedef typename __alloc_traits::size_type size_type;
+ typedef typename __alloc_traits::difference_type difference_type;
typedef __hash_map_iterator<typename __table::iterator> iterator;
typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;