Define std::allocator<T>::is_always_equal
authorJonathan Wakely <jwakely@redhat.com>
Mon, 10 Oct 2016 12:17:45 +0000 (13:17 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 10 Oct 2016 12:17:45 +0000 (13:17 +0100)
* include/bits/allocator.h (allocator<T>::is_always_equal): Define.
* testsuite/20_util/allocator/requirements/typedefs.cc: Test for
is_always_equal.
* testsuite/util/testsuite_allocator.h
(uneq_allocator::is_always_equal): Define as false_type.

From-SVN: r240920

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/allocator.h
libstdc++-v3/testsuite/20_util/allocator/requirements/typedefs.cc
libstdc++-v3/testsuite/util/testsuite_allocator.h

index b6b10e65d32d6b93b50bfdb62cec2196f35149f3..d1e2bc37523349d0f1587a9e530850b6eca05e7a 100644 (file)
@@ -1,5 +1,11 @@
 2016-10-10  Jonathan Wakely  <jwakely@redhat.com>
 
+       * include/bits/allocator.h (allocator<T>::is_always_equal): Define.
+       * testsuite/20_util/allocator/requirements/typedefs.cc: Test for
+       is_always_equal.
+       * testsuite/util/testsuite_allocator.h
+       (uneq_allocator::is_always_equal): Define as false_type.
+
        * include/experimental/numeric (gcd, lcm): Make bool arguments
        ill-formed.
        * include/std/numeric (gcd, lcm): Likewise.
index 984d80075bca2a7a61db73146e87efd05240acd1..8e78165c7f03f296f02617d0ef3030ac5b9cf252 100644 (file)
@@ -50,6 +50,9 @@
 #endif
 
 #define __cpp_lib_incomplete_container_elements 201505
+#if __cplusplus >= 201103L
+# define __cpp_lib_allocator_is_always_equal 201411
+#endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
@@ -80,7 +83,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // 2103. std::allocator propagate_on_container_move_assignment
       typedef true_type propagate_on_container_move_assignment;
 
-#define __cpp_lib_allocator_is_always_equal 201411
       typedef true_type is_always_equal;
 #endif
     };
@@ -113,6 +115,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 2103. std::allocator propagate_on_container_move_assignment
       typedef true_type propagate_on_container_move_assignment;
+
+      typedef true_type is_always_equal;
 #endif
 
       allocator() throw() { }
index 028daa99ceb945454d4bf066eda05b0d845361da..1b3f14fb71724c55008a1c715e58ddd58c88006d 100644 (file)
@@ -48,3 +48,6 @@ static_assert( is_same<allocator<int>::rebind<char>::other,
 static_assert( is_same<allocator<int>::propagate_on_container_move_assignment,
                        std::true_type>::value,
                "propagate_on_container_move_assignment" );
+
+static_assert( is_same<allocator<int>::is_always_equal, std::true_type>::value,
+               "is_always_equal" );
index 8537a831ce883cb74cbf715fa1f7f5ae5a9890a0..dd7e22d41a7802221196a53453ffc9ab079dfcad 100644 (file)
@@ -297,6 +297,7 @@ namespace __gnu_test
 
 #if __cplusplus >= 201103L
       typedef std::true_type                   propagate_on_container_swap;
+      typedef std::false_type                  is_always_equal;
 #endif
 
       template<typename Tp1>