Implement the first part of N4258 - allocator_traits<X>::is_always_equal. Also fixes PR#23723
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238848 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/scoped_allocator b/include/scoped_allocator
index aa8bece..5864689 100644
--- a/include/scoped_allocator
+++ b/include/scoped_allocator
@@ -38,6 +38,7 @@
typedef see below propagate_on_container_copy_assignment;
typedef see below propagate_on_container_move_assignment;
typedef see below propagate_on_container_swap;
+ typedef see below is_always_equal;
template <class Tp>
struct rebind
@@ -170,6 +171,14 @@
__get_poc_swap<_Allocs...>::value;
};
+template <class _A0, class ..._Allocs>
+struct __get_poc_always_equal<_A0, _Allocs...>
+{
+ static const bool value =
+ allocator_traits<_A0>::is_always_equal::value ||
+ __get_poc_always_equal<_Allocs...>::value;
+};
+
template <class ..._Allocs>
class __scoped_allocator_storage;
@@ -397,6 +406,11 @@
bool,
__get_poc_swap<outer_allocator_type, _InnerAllocs...>::value
> propagate_on_container_swap;
+ typedef integral_constant
+ <
+ bool,
+ __get_poc_always_equal<outer_allocator_type, _InnerAllocs...>::value
+ > is_always_equal;
template <class _Tp>
struct rebind