Rename <__hash_table> traits so they don't conflict with similar traits.

In particular <__tree> defines many of the same types of traits classes.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@261421 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-02-20 07:59:16 +00:00
parent 227b47c292
commit 66e344fa9b
2 changed files with 11 additions and 11 deletions

View File

@@ -110,7 +110,7 @@ template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator; template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
template <class _Tp> template <class _Tp>
struct __key_value_types { struct __hash_key_value_types {
static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, ""); static_assert(!is_reference<_Tp>::value && !is_const<_Tp>::value, "");
typedef _Tp key_type; typedef _Tp key_type;
typedef _Tp __node_value_type; typedef _Tp __node_value_type;
@@ -138,7 +138,7 @@ struct __key_value_types {
}; };
template <class _Key, class _Tp> template <class _Key, class _Tp>
struct __key_value_types<__hash_value_type<_Key, _Tp> > { struct __hash_key_value_types<__hash_value_type<_Key, _Tp> > {
typedef _Key key_type; typedef _Key key_type;
typedef _Tp mapped_type; typedef _Tp mapped_type;
typedef __hash_value_type<_Key, _Tp> __node_value_type; typedef __hash_value_type<_Key, _Tp> __node_value_type;
@@ -181,12 +181,12 @@ struct __key_value_types<__hash_value_type<_Key, _Tp> > {
}; };
template <class _Tp, class _AllocPtr, class _KVTypes = __key_value_types<_Tp>, template <class _Tp, class _AllocPtr, class _KVTypes = __hash_key_value_types<_Tp>,
bool = _KVTypes::__is_map> bool = _KVTypes::__is_map>
struct __map_pointer_types {}; struct __hash_map_pointer_types {};
template <class _Tp, class _AllocPtr, class _KVTypes> template <class _Tp, class _AllocPtr, class _KVTypes>
struct __map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> { struct __hash_map_pointer_types<_Tp, _AllocPtr, _KVTypes, true> {
typedef typename _KVTypes::__map_value_type _Mv; typedef typename _KVTypes::__map_value_type _Mv;
typedef typename __rebind_pointer<_AllocPtr, _Mv>::type typedef typename __rebind_pointer<_AllocPtr, _Mv>::type
__map_value_type_pointer; __map_value_type_pointer;
@@ -199,10 +199,10 @@ struct __hash_node_types;
template <class _NodePtr, class _Tp, class _VoidPtr> template <class _NodePtr, class _Tp, class _VoidPtr>
struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> > struct __hash_node_types<_NodePtr, __hash_node<_Tp, _VoidPtr> >
: public __key_value_types<_Tp>, __map_pointer_types<_Tp, _VoidPtr> : public __hash_key_value_types<_Tp>, __hash_map_pointer_types<_Tp, _VoidPtr>
{ {
typedef __key_value_types<_Tp> __base; typedef __hash_key_value_types<_Tp> __base;
public: public:
typedef ptrdiff_t difference_type; typedef ptrdiff_t difference_type;

View File

@@ -18,7 +18,7 @@
void testKeyValueTrait() { void testKeyValueTrait() {
{ {
typedef int Tp; typedef int Tp;
typedef std::__key_value_types<Tp> Traits; typedef std::__hash_key_value_types<Tp> Traits;
static_assert((std::is_same<Traits::key_type, int>::value), ""); static_assert((std::is_same<Traits::key_type, int>::value), "");
static_assert((std::is_same<Traits::__node_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");
static_assert((std::is_same<Traits::__container_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__container_value_type, Tp>::value), "");
@@ -26,7 +26,7 @@ void testKeyValueTrait() {
} }
{ {
typedef std::pair<int, int> Tp; typedef std::pair<int, int> Tp;
typedef std::__key_value_types<Tp> Traits; typedef std::__hash_key_value_types<Tp> Traits;
static_assert((std::is_same<Traits::key_type, Tp>::value), ""); static_assert((std::is_same<Traits::key_type, Tp>::value), "");
static_assert((std::is_same<Traits::__node_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");
static_assert((std::is_same<Traits::__container_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__container_value_type, Tp>::value), "");
@@ -34,7 +34,7 @@ void testKeyValueTrait() {
} }
{ {
typedef std::pair<const int, int> Tp; typedef std::pair<const int, int> Tp;
typedef std::__key_value_types<Tp> Traits; typedef std::__hash_key_value_types<Tp> Traits;
static_assert((std::is_same<Traits::key_type, Tp>::value), ""); static_assert((std::is_same<Traits::key_type, Tp>::value), "");
static_assert((std::is_same<Traits::__node_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");
static_assert((std::is_same<Traits::__container_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__container_value_type, Tp>::value), "");
@@ -42,7 +42,7 @@ void testKeyValueTrait() {
} }
{ {
typedef std::__hash_value_type<int, int> Tp; typedef std::__hash_value_type<int, int> Tp;
typedef std::__key_value_types<Tp> Traits; typedef std::__hash_key_value_types<Tp> Traits;
static_assert((std::is_same<Traits::key_type, int>::value), ""); static_assert((std::is_same<Traits::key_type, int>::value), "");
static_assert((std::is_same<Traits::mapped_type, int>::value), ""); static_assert((std::is_same<Traits::mapped_type, int>::value), "");
static_assert((std::is_same<Traits::__node_value_type, Tp>::value), ""); static_assert((std::is_same<Traits::__node_value_type, Tp>::value), "");