From b81d6f5b8d1675887d440a04ef2b0de9157de7cb Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 1 Jul 2015 21:23:40 +0000 Subject: [PATCH] Noticed that std::allocator was missing the definition for is_always_equal. Fixed this, and added a test for it. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241190 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/memory | 1 + .../allocator.traits.types/is_always_equal.pass.cpp | 4 ++++ .../memory/default.allocator/allocator_types.pass.cpp | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/include/memory b/include/memory index 69702c61..26ba5642 100644 --- a/include/memory +++ b/include/memory @@ -1787,6 +1787,7 @@ public: typedef const _Tp value_type; typedef true_type propagate_on_container_move_assignment; + typedef true_type is_always_equal; template struct rebind {typedef allocator<_Up> other;}; diff --git a/test/std/utilities/memory/allocator.traits/allocator.traits.types/is_always_equal.pass.cpp b/test/std/utilities/memory/allocator.traits/allocator.traits.types/is_always_equal.pass.cpp index 927736cf..31a0f171 100644 --- a/test/std/utilities/memory/allocator.traits/allocator.traits.types/is_always_equal.pass.cpp +++ b/test/std/utilities/memory/allocator.traits/allocator.traits.types/is_always_equal.pass.cpp @@ -45,4 +45,8 @@ int main() static_assert((std::is_same >::is_always_equal, std::true_type>::value), ""); static_assert((std::is_same >::is_always_equal, std::true_type>::value), ""); static_assert((std::is_same >::is_always_equal, std::false_type>::value), ""); + + static_assert((std::is_same >::is_always_equal, std::true_type>::value), ""); + static_assert((std::is_same >::is_always_equal, std::true_type>::value), ""); + static_assert((std::is_same >::is_always_equal, std::false_type>::value), ""); } diff --git a/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp b/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp index db08123a..cba32103 100644 --- a/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp +++ b/test/std/utilities/memory/default.allocator/allocator_types.pass.cpp @@ -22,6 +22,7 @@ // typedef typename add_lvalue_reference::type reference; // typedef typename add_lvalue_reference::type const_reference; // typedef T value_type; +// typedef true_type is_always_equal; // // template struct rebind {typedef allocator other;}; // ... @@ -42,6 +43,10 @@ int main() static_assert((std::is_same::const_reference, const char&>::value), ""); static_assert((std::is_same::rebind::other, std::allocator >::value), ""); + + static_assert((std::is_same::is_always_equal, std::true_type>::value), ""); + static_assert((std::is_same::is_always_equal, std::true_type>::value), ""); + std::allocator a; std::allocator a2 = a; a2 = a;