[cfe-dev] problem with std::function and virtual destructor

Richard Smith richard at metafoo.co.uk
Sun Jul 15 16:12:03 PDT 2012


On Sun, Jul 15, 2012 at 2:11 PM, Steve Ramsey <clang at lucena.com> wrote:

> On Jul 15, 2012, at 1:55 PM, Rich E wrote:
> > On Sun, Jul 15, 2012 at 1:38 PM, Steve Ramsey <clang at lucena.com> wrote:
> >> This is correct behavior as per FDIS 12.8.18. Specifically, since
> there's a user-declared copy constructor, there needs to be a user-declared
> copy-assignment operator, if you want one; otherwise, the implicitly
> declared one is defined as deleted.
> >>
> > Excuse my ignorance, but how is there a user-declared copy constructor?
>
> Excuse my lack of proofreading; I meant user-declared destructor.


That's still not right: the rule you're referencing only applies to move
operations. The implicit declaration of non-deleted copy operations still
happens in this case, but it's deprecated (the committee didn't want to
break a big pile of existing code, IIUC).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120715/4515ee5f/attachment.html>


More information about the cfe-dev mailing list