Boost logo

Boost Users :

Subject: Re: [Boost-users] [Thread] Can't compile package_task code with 1.54
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2013-06-01 13:24:02


2013/6/1 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>

>
> I've a clear answer from Howard. See below.
>
> Le 01/06/13 18:29, Howard Hinnant a écrit :
>
> The reason F has to be CopyConstructible is not because of the signatures of the constructor and assignment operator. Both could be F, or F&&, and we appear to have split the difference. :-)
>
> The reason F has to be CopyConstructible is because of function's copy constructor, and because F is type-erased inside of function. Because F is type-erased, when function is copied, it must copy F using a virtual function call (or via a function pointer). And because F's copy constructor must be called via a virtual function, F's copy constructor is instantiated whether or not function's copy constructor is instantiated. And that is why F must be CopyConstructible.
>
> If F was not type-erased inside of function, F would not have to be CopyConstructible until actually copied.
>
>
>
>
Ah, perfectly clear now. Awesome of you to to share the info.

Regards,
Simon



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net