https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97207

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If you don't want to support assignment you can still support swapping:

--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1546,9 +1546,21 @@ public:
       this->m_vec = r.m_vec;
       r.m_vec = NULL;
     }
+
   void operator= (auto_vec&&) = delete;
+
+  void swap(auto_vec&& r)
+    {
+      std::swap(this->m_vec = r.m_vec);
+    }
 };

+template<typename T>
+void swap(auto_vec<T>& l, auto_vec<T>& r)
+{
+  l.swap(r);
+}
+

 /* Allocate heap memory for pointer V and create the internal vector
    with space for NELEMS elements.  If NELEMS is 0, the internal


Then use swap(v1, v2) not std::swap(v1, v2)

Reply via email to