projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
473da7e
)
middle-end/97207 - implement move assign for auto_vec<>
author
Richard Biener
<rguenther@suse.de>
Fri, 25 Sep 2020 11:59:15 +0000
(13:59 +0200)
committer
Richard Biener
<rguenther@suse.de>
Fri, 25 Sep 2020 12:51:26 +0000
(14:51 +0200)
This implements the missing move assignment to make std::swap work
on auto_vec<>
2020-09-25 Richard Biener <rguenther@suse.de>
PR middle-end/97207
* vec.h (auto_vec<T>::operator=(auto_vec<T>&&)): Implement.
gcc/vec.h
patch
|
blob
|
history
diff --git
a/gcc/vec.h
b/gcc/vec.h
index d73d865cff264ff5b70a0d2dd389c74e4c426be8..d8c7cdac073fa846722b6e9a9ee17b0413a3ea79 100644
(file)
--- a/
gcc/vec.h
+++ b/
gcc/vec.h
@@
-1546,7
+1546,13
@@
public:
this->m_vec = r.m_vec;
r.m_vec = NULL;
}
- void operator= (auto_vec&&) = delete;
+ auto_vec& operator= (auto_vec&& r)
+ {
+ this->release ();
+ this->m_vec = r.m_vec;
+ r.m_vec = NULL;
+ return *this;
+ }
};