From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4353 invoked by alias); 7 Nov 2011 10:48:42 -0000 Received: (qmail 4344 invoked by uid 22791); 7 Nov 2011 10:48:41 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Nov 2011 10:48:27 +0000 Received: by wwf27 with SMTP id 27so5840175wwf.8 for ; Mon, 07 Nov 2011 02:48:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.156.15 with SMTP id l15mr3601123wek.36.1320662906415; Mon, 07 Nov 2011 02:48:26 -0800 (PST) Received: by 10.216.63.83 with HTTP; Mon, 7 Nov 2011 02:48:26 -0800 (PST) In-Reply-To: References: Date: Mon, 07 Nov 2011 10:48:00 -0000 Message-ID: Subject: Re: std::packaged_task trunk problem From: Jonathan Wakely To: =?ISO-8859-1?Q?Lars_Gullik_Bj=F8nnes?= Cc: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00055.txt.bz2 On 7 November 2011 10:46, Lars Gullik Bj=F8nnes 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 :-\