From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "Lars Gullik Bjønnes" <larsbj@gullik.org>
Cc: gcc-help@gcc.gnu.org
Subject: Re: std::packaged_task trunk problem
Date: Mon, 07 Nov 2011 09:51:00 -0000 [thread overview]
Message-ID: <CAH6eHdQA=AXygiADepOLSOwftO46X0YvDnoUVD3C3KKSDBh3_A@mail.gmail.com> (raw)
In-Reply-To: <m3obwofflu.fsf@black.gullik.net>
On 7 November 2011 09:26, Lars Gullik Bjønnes wrote:
>
> This is the wrapper I ended up with. I had to remove the throw, it
> triggered all the time.
What if you give PretendToBeCopyable a noexcept destructor?
That should ensure the container will move it rather than copy it,
whenever possible.
> template<typename Moveable>
> struct PretendToBeCopyable
> {
> explicit PretendToBeCopyable(Moveable&& m) : m(std::move(m)) {}
> PretendToBeCopyable(PretendToBeCopyable&&) = default;
> PretendToBeCopyable(PretendToBeCopyable& p)
> : m(std::move(p.m)) {}
> void operator()() { m(); }
~PretendToBeCopyable() noexcept = default;
> private:
> Moveable m;
> };
>
> }
next prev parent reply other threads:[~2011-11-07 9:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-01 11:00 Lars Gullik Bjønnes
2011-11-01 15:03 ` Jonathan Wakely
2011-11-01 15:08 ` Jonathan Wakely
2011-11-01 15:13 ` Lars Gullik Bjønnes
2011-11-02 0:56 ` Jonathan Wakely
2011-11-02 2:01 ` Lars Gullik Bjønnes
2011-11-02 9:06 ` Jonathan Wakely
2011-11-02 10:03 ` Jonathan Wakely
2011-11-02 11:22 ` Jonathan Wakely
2011-11-02 12:01 ` Jonathan Wakely
2011-11-03 13:13 ` Lars Gullik Bjønnes
2011-11-03 16:18 ` Jonathan Wakely
2011-11-03 16:18 ` Jonathan Wakely
2011-11-07 9:26 ` Lars Gullik Bjønnes
2011-11-07 9:51 ` Jonathan Wakely [this message]
2011-11-07 9:53 ` Jonathan Wakely
2011-11-07 10:09 ` Lars Gullik Bjønnes
2011-11-07 10:37 ` Jonathan Wakely
2011-11-07 10:47 ` Lars Gullik Bjønnes
2011-11-07 10:48 ` Jonathan Wakely
2011-11-07 22:43 ` Lars Gullik Bjønnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH6eHdQA=AXygiADepOLSOwftO46X0YvDnoUVD3C3KKSDBh3_A@mail.gmail.com' \
--to=jwakely.gcc@gmail.com \
--cc=gcc-help@gcc.gnu.org \
--cc=larsbj@gullik.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).