From d6dfa3dafc0a69a84002f1c0be17a70b0996cc72 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 17 Feb 2020 13:20:57 +0000 Subject: [PATCH] libstdc++: Make "implicit expression variants" more explicit (P2102R0) * include/bits/iterator_concepts.h (indirectly_copyable_storable): Add const-qualified expression variations. * include/std/concepts (copyable): Likewise. --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/include/bits/iterator_concepts.h | 3 +++ libstdc++-v3/include/std/concepts | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 2dca4b50dd7..c9660084179 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2020-02-17 Jonathan Wakely + * include/bits/iterator_concepts.h (indirectly_copyable_storable): Add + const-qualified expression variations. + * include/std/concepts (copyable): Likewise. + * include/std/type_traits (__is_standard_integer): New helper trait. * include/std/utility (cmp_equal, cmp_not_equal, cmp_less, cmp_greater) (cmp_less_equal, cmp_greater_equal, in_range): Define for C++20. diff --git a/libstdc++-v3/include/bits/iterator_concepts.h b/libstdc++-v3/include/bits/iterator_concepts.h index 04c862a4b97..792b3262106 100644 --- a/libstdc++-v3/include/bits/iterator_concepts.h +++ b/libstdc++-v3/include/bits/iterator_concepts.h @@ -693,7 +693,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template concept indirectly_copyable_storable = indirectly_copyable<_In, _Out> + && indirectly_writable<_Out, iter_value_t<_In>&> && indirectly_writable<_Out, const iter_value_t<_In>&> + && indirectly_writable<_Out, iter_value_t<_In>&&> + && indirectly_writable<_Out, const iter_value_t<_In>&&> && copyable> && constructible_from, iter_reference_t<_In>> && assignable_from&, iter_reference_t<_In>>; diff --git a/libstdc++-v3/include/std/concepts b/libstdc++-v3/include/std/concepts index db614899942..acc9dd2599d 100644 --- a/libstdc++-v3/include/std/concepts +++ b/libstdc++-v3/include/std/concepts @@ -251,7 +251,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template concept copyable = copy_constructible<_Tp> && movable<_Tp> - && assignable_from<_Tp&, const _Tp&>; + && assignable_from<_Tp&, _Tp&> && assignable_from<_Tp&, const _Tp&> + && assignable_from<_Tp&, const _Tp>; template concept semiregular = copyable<_Tp> && default_initializable<_Tp>; -- 2.30.2