summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/ext
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-01-30 07:44:22 +0000
committerdim <dim@FreeBSD.org>2014-01-30 07:44:22 +0000
commit0b319638e352dd16f2e5a243bd3826d37eef1680 (patch)
treeadd3759d4df7ee10d814c3b2561c3c28fcd9cef2 /contrib/libc++/include/ext
parent9cecf9778c1472e916ad20086c11e4bf332ba6ad (diff)
parentc3e10da3dc0f616b78ccf85206fdcf4c92f8ac85 (diff)
downloadFreeBSD-src-0b319638e352dd16f2e5a243bd3826d37eef1680.zip
FreeBSD-src-0b319638e352dd16f2e5a243bd3826d37eef1680.tar.gz
Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y. MFC after: 3 weeks
Diffstat (limited to 'contrib/libc++/include/ext')
-rw-r--r--contrib/libc++/include/ext/__hash6
-rw-r--r--contrib/libc++/include/ext/hash_map34
-rw-r--r--contrib/libc++/include/ext/hash_set10
3 files changed, 29 insertions, 21 deletions
diff --git a/contrib/libc++/include/ext/__hash b/contrib/libc++/include/ext/__hash
index f6ecfe3..c0523cc 100644
--- a/contrib/libc++/include/ext/__hash
+++ b/contrib/libc++/include/ext/__hash
@@ -19,10 +19,10 @@
namespace __gnu_cxx {
using namespace std;
-template <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T>
+template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash : public std::hash<_Tp>
{ };
-template <> struct _LIBCPP_TYPE_VIS hash<const char*>
+template <> struct _LIBCPP_TYPE_VIS_ONLY hash<const char*>
: public unary_function<const char*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -32,7 +32,7 @@ template <> struct _LIBCPP_TYPE_VIS hash<const char*>
}
};
-template <> struct _LIBCPP_TYPE_VIS hash<char *>
+template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char *>
: public unary_function<char*, size_t>
{
_LIBCPP_INLINE_VISIBILITY
diff --git a/contrib/libc++/include/ext/hash_map b/contrib/libc++/include/ext/hash_map
index a6fe894..225b72b 100644
--- a/contrib/libc++/include/ext/hash_map
+++ b/contrib/libc++/include/ext/hash_map
@@ -206,7 +206,11 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <ext/__hash>
#if __DEPRECATED
-#warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
+#if defined(_MSC_VER) && ! defined(__clang__)
+ _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>")
+#else
+# warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>
+#endif
#endif
#pragma GCC system_header
@@ -361,7 +365,7 @@ public:
};
template <class _HashIterator>
-class _LIBCPP_TYPE_VIS __hash_map_iterator
+class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator
{
_HashIterator __i_;
@@ -404,15 +408,15 @@ public:
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_multimap;
- template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS __hash_map_const_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
};
template <class _HashIterator>
-class _LIBCPP_TYPE_VIS __hash_map_const_iterator
+class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator
{
_HashIterator __i_;
@@ -463,15 +467,15 @@ public:
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_map;
- template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS hash_multimap;
- template <class> friend class _LIBCPP_TYPE_VIS __hash_const_iterator;
- template <class> friend class _LIBCPP_TYPE_VIS __hash_const_local_iterator;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_map;
+ template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap;
+ template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
+ template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
};
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS hash_map
+class _LIBCPP_TYPE_VIS_ONLY hash_map
{
public:
// types
@@ -684,7 +688,7 @@ hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k)
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
@@ -750,7 +754,7 @@ operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
-class _LIBCPP_TYPE_VIS hash_multimap
+class _LIBCPP_TYPE_VIS_ONLY hash_multimap
{
public:
// types
diff --git a/contrib/libc++/include/ext/hash_set b/contrib/libc++/include/ext/hash_set
index 52bbeee..c4bb898 100644
--- a/contrib/libc++/include/ext/hash_set
+++ b/contrib/libc++/include/ext/hash_set
@@ -199,7 +199,11 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <ext/__hash>
#if __DEPRECATED
-#warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>
+#if defined(_MSC_VER) && ! defined(__clang__)
+ _LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>")
+#else
+# warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>
+#endif
#endif
namespace __gnu_cxx {
@@ -208,7 +212,7 @@ using namespace std;
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_TYPE_VIS hash_set
+class _LIBCPP_TYPE_VIS_ONLY hash_set
{
public:
// types
@@ -429,7 +433,7 @@ operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x,
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
-class _LIBCPP_TYPE_VIS hash_multiset
+class _LIBCPP_TYPE_VIS_ONLY hash_multiset
{
public:
// types
OpenPOWER on IntegriCloud