summaryrefslogtreecommitdiff
path: root/include/memory
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/memory
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/memory')
-rw-r--r--include/memory10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/memory b/include/memory
index 43f8dbada..93e8f6737 100644
--- a/include/memory
+++ b/include/memory
@@ -1635,6 +1635,16 @@ private:
{return __a;}
};
+template <class _Traits, class _Tp>
+struct __rebind_alloc_helper
+{
+#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
+ typedef typename _Traits::template rebind_alloc<_Tp> type;
+#else
+ typedef typename _Traits::template rebind_alloc<_Tp>::other type;
+#endif
+};
+
// allocator
template <class _Tp>