This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::packaged_task trunk problem


Jonathan Wakely <jwakely.gcc@gmail.com> writes:

| On 7 November 2011 10:46, Lars Gullik Bjønnes wrote:
>>
>> Yes it compiles. The copy constructor is still run, but if having that
>> throw I still get into std::terminate.
>
| The reason the copy constructor does still get called is because
| std::function doesn't have a noexcept move constructor, so resizing
| the vector will copy the function (which copies its target
| PretendToBeCopyable) instead of moving it.
>
| I hadn't realised how hard it is to make this work with the final
| C++11 rules :-\

I guess I am into more fun now that I want my spawn_task to take
arguments for the spawned function as well. :-)

-- 
   Lgb


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]