[gcc(refs/users/ppalka/heads/libstdcxx-constrained-algos)] Simplify the way we disable copyability of {input, output}_iterators

Patrick Palka ppalka@gcc.gnu.org
Mon Jan 27 15:26:00 GMT 2020


https://gcc.gnu.org/g:cecc3fb44826d07d2193679f1315408566c99e45

commit cecc3fb44826d07d2193679f1315408566c99e45
Author: Patrick Palka <ppalka@redhat.com>
Date:   Sun Jan 26 22:53:47 2020 -0500

    Simplify the way we disable copyability of {input,output}_iterators

Diff:
---
 libstdc++-v3/testsuite/util/testsuite_iterators.h | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index 22fa3fd..a1071a6 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -28,6 +28,7 @@
 // test_container, which is given two pointers to T and an iterator type.
 
 #include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
 #include <bits/stl_iterator_base_types.h>
 
 #if __cplusplus >= 201103L
@@ -658,18 +659,7 @@ namespace __gnu_test
   struct disable_copy { };
 
   template<>
-  struct disable_copy<true>
-  {
-    disable_copy() noexcept = default;
-
-    disable_copy(disable_copy&&) noexcept = default;
-    disable_copy&
-    operator=(disable_copy&&) noexcept = default;
-
-    disable_copy(const disable_copy&) noexcept = delete;
-    disable_copy&
-    operator=(const disable_copy&) noexcept = delete;
-  };
+  struct disable_copy<true> : __gnu_test::rvalstruct { };
 
   template<>
   struct disable_copy<false> { };



More information about the Libstdc++-cvs mailing list