[committed] libstdc++: Make "implicit expression variants" more explicit (P2102R0)

Message ID 20200217132213.GA1504943@redhat.com
State New
Headers show
Series
  • [committed] libstdc++: Make "implicit expression variants" more explicit (P2102R0)
Related show

Commit Message

Jonathan Wakely Feb. 17, 2020, 1:22 p.m.
* include/bits/iterator_concepts.h (indirectly_copyable_storable): Add
	const-qualified expression variations.
	* include/std/concepts (copyable): Likewise.

Tested powerpc64le-linux, committed to master.
commit d6dfa3dafc0a69a84002f1c0be17a70b0996cc72
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Feb 17 13:20:57 2020 +0000

    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.

Patch

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<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>>;
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<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>;