summaryrefslogtreecommitdiffstats
path: root/libcxx/include/ext/hash_set
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-05-17 20:46:00 +0000
committerEric Fiselier <eric@efcs.ca>2019-05-17 20:46:00 +0000
commit549ddae58f7caab3f47da4c47f591c322dab9a2d (patch)
tree50f258fc61d6bc91defb99a124580ca19141cdac /libcxx/include/ext/hash_set
parent182c638fe090803a9e8ad2b357bb1df9500ae7af (diff)
downloadbcm5719-llvm-549ddae58f7caab3f47da4c47f591c322dab9a2d.tar.gz
bcm5719-llvm-549ddae58f7caab3f47da4c47f591c322dab9a2d.zip
Remove `using namespace std;` in __gnu_cxx namespace.
The `using namespace std;` opens us up to ambiguity when any of the std:: names are also present in the global namespace. Instead we should properly qualify names we use from std::. llvm-svn: 361074
Diffstat (limited to 'libcxx/include/ext/hash_set')
-rw-r--r--libcxx/include/ext/hash_set27
1 files changed, 13 insertions, 14 deletions
diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set
index 21e66877c9f..e5141824b60 100644
--- a/libcxx/include/ext/hash_set
+++ b/libcxx/include/ext/hash_set
@@ -207,10 +207,9 @@ template <class Value, class Hash, class Pred, class Alloc>
namespace __gnu_cxx {
-using namespace std;
-template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
- class _Alloc = allocator<_Value> >
+template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value> >
class _LIBCPP_TEMPLATE_VIS hash_set
{
public:
@@ -224,7 +223,7 @@ public:
typedef const value_type& const_reference;
private:
- typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;
+ typedef std::__hash_table<value_type, hasher, key_equal, allocator_type> __table;
__table __table_;
@@ -276,7 +275,7 @@ public:
const_iterator end() const {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
- pair<iterator, bool> insert(const value_type& __x)
+ std::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;}
@@ -309,10 +308,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
- pair<iterator, iterator> equal_range(const key_type& __k)
+ std::pair<iterator, iterator> equal_range(const key_type& __k)
{return __table_.__equal_range_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
- pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
+ std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
@@ -431,8 +430,8 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
return !(__x == __y);
}
-template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
- class _Alloc = allocator<_Value> >
+template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>,
+ class _Alloc = std::allocator<_Value> >
class _LIBCPP_TEMPLATE_VIS hash_multiset
{
public:
@@ -446,7 +445,7 @@ public:
typedef const value_type& const_reference;
private:
- typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;
+ typedef std::__hash_table<value_type, hasher, key_equal, allocator_type> __table;
__table __table_;
@@ -530,10 +529,10 @@ public:
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
- pair<iterator, iterator> equal_range(const key_type& __k)
+ std::pair<iterator, iterator> equal_range(const key_type& __k)
{return __table_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
- pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
+ std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
@@ -610,7 +609,7 @@ template <class _InputIterator>
inline
void
hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
- _InputIterator __last)
+ _InputIterator __last)
{
for (; __first != __last; ++__first)
__table_.__insert_multi(*__first);
@@ -634,7 +633,7 @@ operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
return false;
typedef typename hash_multiset<_Value, _Hash, _Pred, _Alloc>::const_iterator
const_iterator;
- typedef pair<const_iterator, const_iterator> _EqRng;
+ typedef std::pair<const_iterator, const_iterator> _EqRng;
for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;)
{
_EqRng __xeq = __x.equal_range(*__i);
OpenPOWER on IntegriCloud