On Tue, Apr 27, 2021 at 2:46 AM Martin Sebor via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> PR 90904 notes that auto_vec is unsafe to copy and assign because
> the class manages its own memory but doesn't define (or delete)
> either special function.  Since I first ran into the problem,
> auto_vec has grown a move ctor and move assignment from
> a dynamically-allocated vec but still no copy ctor or copy
> assignment operator.
>
> The attached patch adds the two special functions to auto_vec along
> with a few simple tests.  It makes auto_vec safe to use in containers
> that expect copyable and assignable element types and passes bootstrap
> and regression testing on x86_64-linux.

The question is whether we want such uses to appear since those
can be quite inefficient?  Thus the option is to delete those operators?

Richard.

> Martin

Reply via email to