Add two missing members from the extension hash containers. The first is
the type name 'data_type', which is specified by the SGI spec as being
the correct type name for the mapped type. The second is an overload of
insert found in standard containers, taking an iterator as a 'hint'
(which we ignore in the standard containers as well). libstdc++'s
implementation includes these overloads, and they are needed to make
insert_iterator work (which I suspect is the real motivation for
including them in the standard containers).
The motivation for including these overloads of insert and leaving the
mapped_type typedef is to make it easier for clients to migrate to the
standard containers.
llvm-svn: 136538
diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index b74540b..21ce3be 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -468,6 +468,7 @@
// types
typedef _Key key_type;
typedef _Tp mapped_type;
+ typedef _Tp data_type;
typedef _Hash hasher;
typedef _Pred key_equal;
typedef _Alloc allocator_type;
@@ -551,6 +552,8 @@
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(const value_type& __x)
{return __table_.__insert_unique(__x);}
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;}
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last);
@@ -744,6 +747,7 @@
// types
typedef _Key key_type;
typedef _Tp mapped_type;
+ typedef _Tp data_type;
typedef _Hash hasher;
typedef _Pred key_equal;
typedef _Alloc allocator_type;
@@ -825,6 +829,8 @@
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
+ _LIBCPP_INLINE_VISIBILITY
+ iterator insert(const_iterator, const value_type& __x) {return insert(__x);}
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last);