summaryrefslogtreecommitdiff
path: root/include/map
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2015-04-07 05:21:38 +0000
committerMarshall Clow <mclow.lists@gmail.com>2015-04-07 05:21:38 +0000
commit66302c650b16a0b8134a50e0fe368d1d69952863 (patch)
treec322169ccd370a86bba163a4b174a1b72677dedc /include/map
parent6be02cb83f78d11afb94c3886729ce4198fa61e0 (diff)
In many places, there was an #ifdef/#else block that selected one of two implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@234296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/map')
-rw-r--r--include/map18
1 files changed, 4 insertions, 14 deletions
diff --git a/include/map b/include/map
index 0b5eb2094..c8e8fd1f1 100644
--- a/include/map
+++ b/include/map
@@ -822,13 +822,8 @@ private:
typedef _VSTD::__value_type<key_type, mapped_type> __value_type;
typedef __map_value_compare<key_type, __value_type, key_compare> __vc;
- typedef typename allocator_traits<allocator_type>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind_alloc<__value_type>
-#else
- rebind_alloc<__value_type>::other
-#endif
- __allocator_type;
+ typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
+ __value_type>::type __allocator_type;
typedef __tree<__value_type, __vc, __allocator_type> __base;
typedef typename __base::__node_traits __node_traits;
typedef allocator_traits<allocator_type> __alloc_traits;
@@ -1568,13 +1563,8 @@ private:
typedef _VSTD::__value_type<key_type, mapped_type> __value_type;
typedef __map_value_compare<key_type, __value_type, key_compare> __vc;
- typedef typename allocator_traits<allocator_type>::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind_alloc<__value_type>
-#else
- rebind_alloc<__value_type>::other
-#endif
- __allocator_type;
+ typedef typename __rebind_alloc_helper<allocator_traits<allocator_type>,
+ __value_type>::type __allocator_type;
typedef __tree<__value_type, __vc, __allocator_type> __base;
typedef typename __base::__node_traits __node_traits;
typedef allocator_traits<allocator_type> __alloc_traits;