libstdc++: Make "implicit expression variants" more explicit (P2102R0)
authorJonathan Wakely <jwakely@redhat.com>
Mon, 17 Feb 2020 13:20:57 +0000 (13:20 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 17 Feb 2020 13:20:57 +0000 (13:20 +0000)
* include/bits/iterator_concepts.h (indirectly_copyable_storable): Add
const-qualified expression variations.
* include/std/concepts (copyable): Likewise.

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/iterator_concepts.h
libstdc++-v3/include/std/concepts

index 2dca4b50dd79719bcb001c7bd1b376bc685460d0..c9660084179bedc9ece911c7cca175067e1972c3 100644 (file)
@@ -1,5 +1,9 @@
 2020-02-17  Jonathan Wakely  <jwakely@redhat.com>
 
+       * 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.
index 04c862a4b97829f5eefd5cb2a1720e2028e7e3ac..792b32621066ad0154db4a3fe8290a468a2b6534 100644 (file)
@@ -693,7 +693,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _In, typename _Out>
     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<iter_value_t<_In>>
       && constructible_from<iter_value_t<_In>, iter_reference_t<_In>>
       && assignable_from<iter_value_t<_In>&, iter_reference_t<_In>>;
index db6148999420c372aab97853cded2616c4aa1c19..acc9dd2599da27762ea6d887fc644277c1d9734b 100644 (file)
@@ -251,7 +251,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<typename _Tp>
     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<typename _Tp>
     concept semiregular = copyable<_Tp> && default_initializable<_Tp>;