From 46942c810112eb655f1dfd223055c60208403ad0 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 10 Oct 2016 13:17:45 +0100 Subject: [PATCH] Define std::allocator::is_always_equal * include/bits/allocator.h (allocator::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 | 6 ++++++ libstdc++-v3/include/bits/allocator.h | 6 +++++- .../testsuite/20_util/allocator/requirements/typedefs.cc | 3 +++ libstdc++-v3/testsuite/util/testsuite_allocator.h | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b6b10e65d32..d1e2bc37523 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2016-10-10 Jonathan Wakely + * include/bits/allocator.h (allocator::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. diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h index 984d80075bc..8e78165c7f0 100644 --- a/libstdc++-v3/include/bits/allocator.h +++ b/libstdc++-v3/include/bits/allocator.h @@ -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() { } diff --git a/libstdc++-v3/testsuite/20_util/allocator/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/allocator/requirements/typedefs.cc index 028daa99ceb..1b3f14fb717 100644 --- a/libstdc++-v3/testsuite/20_util/allocator/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/20_util/allocator/requirements/typedefs.cc @@ -48,3 +48,6 @@ static_assert( is_same::rebind::other, static_assert( is_same::propagate_on_container_move_assignment, std::true_type>::value, "propagate_on_container_move_assignment" ); + +static_assert( is_same::is_always_equal, std::true_type>::value, + "is_always_equal" ); diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h index 8537a831ce8..dd7e22d41a7 100644 --- a/libstdc++-v3/testsuite/util/testsuite_allocator.h +++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h @@ -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 -- 2.30.2