On Fri, 18 Jun 2021 at 11:54, Jakub Jelinek <ja...@redhat.com> wrote: > > On Fri, Jun 18, 2021 at 12:38:09PM +0200, Richard Biener via Gcc-patches > wrote: > > > Yes, as we discussed in the review below, vec is not a good model > > > because (as you note again above) it's constrained by its legacy > > > uses. The best I think we can do for it is to make it safer to > > > use. > > > https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571622.html > > > > Which is what Trevors patches do by simply disallowing things > > that do not work at the moment. > > I only see > // You probably don't want to copy a vector, so these are deleted to prevent > // unintentional use. If you really need a copy of the vectors contents you > // can use copy (). > auto_vec(const auto_vec &) = delete; > auto_vec &operator= (const auto_vec &) = delete; > on the > template<typename T> > class auto_vec<T, 0> : public vec<T, va_heap> > specialization, but not on the > template<typename T, size_t N = 0> > class auto_vec : public vec<T, va_heap> > template itself. Shouldn't that one have also the deleted > copy ctor/assignment operator and in addition to that maybe deleted > move ctor/move assignment operator?
That might have some value as documentation for people reading the code, but it's not necessary. If vec has a deleted copy ctor and copy assignment then it has no implicitly-defined move ctor and move assignment. And the same goes for anything deriving from vec.