summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-07-29 23:31:53 +0000
committerAlexis Hunt <alercah@gmail.com>2011-07-29 23:31:53 +0000
commitfe473ae27747fec22e90083b26c1f81b31a3c68c (patch)
tree07ba47b5b6a61dc12995ba9506ad1f71728d6c8f /libcxx
parentd451ea9ca92d26eafa2e0794da87a9a8c2a3149a (diff)
downloadbcm5719-llvm-fe473ae27747fec22e90083b26c1f81b31a3c68c.tar.gz
bcm5719-llvm-fe473ae27747fec22e90083b26c1f81b31a3c68c.zip
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
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/ext/hash_map6
-rw-r--r--libcxx/include/ext/hash_set4
2 files changed, 10 insertions, 0 deletions
diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map
index b74540be7f4..21ce3be8a18 100644
--- a/libcxx/include/ext/hash_map
+++ b/libcxx/include/ext/hash_map
@@ -468,6 +468,7 @@ public:
// 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 @@ public:
_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 @@ public:
// 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 @@ public:
_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);
diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index e20fd41e6fd..daad847afb3 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -274,6 +274,8 @@ public:
_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);
@@ -492,6 +494,8 @@ public:
_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);
OpenPOWER on IntegriCloud