aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2014-06-25 21:54:34 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2014-06-25 21:54:34 +0100
commit484dc5996f12cadb01e01e224541f4ae693f0b6c (patch)
treef3a84d666fa92e4f7a93b4d2eb03df42dc538a1d
parent99c39534a552d65a2e652a8f44eef6189653bf25 (diff)
downloadgcc-484dc5996f12cadb01e01e224541f4ae693f0b6c.zip
gcc-484dc5996f12cadb01e01e224541f4ae693f0b6c.tar.gz
gcc-484dc5996f12cadb01e01e224541f4ae693f0b6c.tar.bz2
alloc_traits.h (__alloc_rebind): Define alias template.
* include/bits/alloc_traits.h (__alloc_rebind): Define alias template. * include/bits/forward_list.h (_Fwd_list_base): Use __alloc_rebind. * include/bits/hashtable_policy.h (_Insert_base, _Hashtable_alloc): Likewise. * include/ext/alloc_traits.h: Fix comment. From-SVN: r211995
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/alloc_traits.h3
-rw-r--r--libstdc++-v3/include/bits/forward_list.h9
-rw-r--r--libstdc++-v3/include/bits/hashtable_policy.h7
-rw-r--r--libstdc++-v3/include/ext/alloc_traits.h2
5 files changed, 17 insertions, 12 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 864f7b2..2042b55 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-25 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/alloc_traits.h (__alloc_rebind): Define alias template.
+ * include/bits/forward_list.h (_Fwd_list_base): Use __alloc_rebind.
+ * include/bits/hashtable_policy.h (_Insert_base, _Hashtable_alloc):
+ Likewise.
+ * include/ext/alloc_traits.h: Fix comment.
+
2014-06-24 Jonathan Wakely <jwakely@redhat.com>
* include/bits/functexcept.h (__throw_out_of_range_fmt): Change
diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index 23fe8de..3afcc6f 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -72,6 +72,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef _Alloc<_Tp, _Args...> __type;
};
+ template<typename _Ptr, typename _Tp>
+ using __alloc_rebind = typename __alloctr_rebind<_Ptr, _Tp>::__type;
+
/**
* @brief Uniform interface to all allocator types.
* @ingroup allocators
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index 524fad1..7cf699e 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -274,13 +274,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
struct _Fwd_list_base
{
protected:
- typedef typename __gnu_cxx::__alloc_traits<_Alloc> _Alloc_traits;
- typedef typename _Alloc_traits::template rebind<_Tp>::other
- _Tp_alloc_type;
-
- typedef typename _Alloc_traits::template
- rebind<_Fwd_list_node<_Tp>>::other _Node_alloc_type;
-
+ typedef __alloc_rebind<_Alloc, _Tp> _Tp_alloc_type;
+ typedef __alloc_rebind<_Alloc, _Fwd_list_node<_Tp>> _Node_alloc_type;
typedef __gnu_cxx::__alloc_traits<_Node_alloc_type> _Node_alloc_traits;
struct _Fwd_list_impl
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index ef15b0e..606fbab 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -701,8 +701,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __unique_keys = typename __hashtable_base::__unique_keys;
using __ireturn_type = typename __hashtable_base::__ireturn_type;
using __node_type = _Hash_node<_Value, _Traits::__hash_cached::value>;
- using __node_alloc_type =
- typename __alloctr_rebind<_Alloc, __node_type>::__type;
+ using __node_alloc_type = __alloc_rebind<_Alloc, __node_type>;
using __node_gen_type = _AllocNode<__node_alloc_type>;
__hashtable&
@@ -1898,13 +1897,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __value_type = typename __node_type::value_type;
using __value_alloc_type =
- typename __alloctr_rebind<__node_alloc_type, __value_type>::__type;
+ __alloc_rebind<__node_alloc_type, __value_type>;
using __value_alloc_traits = std::allocator_traits<__value_alloc_type>;
using __node_base = __detail::_Hash_node_base;
using __bucket_type = __node_base*;
using __bucket_alloc_type =
- typename __alloctr_rebind<__node_alloc_type, __bucket_type>::__type;
+ __alloc_rebind<__node_alloc_type, __bucket_type>;
using __bucket_alloc_traits = std::allocator_traits<__bucket_alloc_type>;
_Hashtable_alloc(const _Hashtable_alloc&) = default;
diff --git a/libstdc++-v3/include/ext/alloc_traits.h b/libstdc++-v3/include/ext/alloc_traits.h
index 14fbc43..abdb61151 100644
--- a/libstdc++-v3/include/ext/alloc_traits.h
+++ b/libstdc++-v3/include/ext/alloc_traits.h
@@ -210,6 +210,6 @@ template<typename _Alloc>
};
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace std
+} // namespace __gnu_cxx
#endif