public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
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: Wed, 02 Nov 2011 12:01:00 -0000	[thread overview]
Message-ID: <CAH6eHdTTYj9cD_NVMJXO-v0zEo5ng7es1vaP+HWhdGXHSxL1cA@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdS50A4OOJJ7cZyhMKMzxOYk0qgdymZE3e8C+qKdV-GgcQ@mail.gmail.com>

On 2 November 2011 11:22, Jonathan Wakely wrote:
> On 2 November 2011 10:03, Jonathan Wakely wrote:
>> On 2 November 2011 09:06, Jonathan Wakely wrote:
>>> On 2 November 2011 02:01, Lars Gullik Bjønnes wrote:
>>>>
>>>> Now of to next problem on how to store a std::packaged_task in a container.
>>>
>>> That should work because packaged_task is nothrow move constructible,
>>> but it looks as though there may be a problem with the
>>> _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR code ... I'd better look into
>>> that too.
>>>
>>
>> is_nothrow_move_constructible<packaged_task<T>>::value is false,
>> because packaged_task's destructor is not noexcept.  I'm not sure yet
>> if that's correct or not...
>
> It's correct that
> is_nothrow_move_constructible<packaged_task<T>>::value is false, but
> that shouldn't prevent it being stored in a container. I'll file a
> bugzilla report.

Bah, I think my first test was flawed - it works storing them in
containers if you only use the members that support MoveInsertable

i.e. this fails as it requires CopyInsertable:
vector<packaged_task<void()>> v{ packaged_task<void()>{} };

this is OK, it only requires MoveInsertable:
vector<packaged_task<void()>> v;
v.push_back( packaged_task<void()>{} );

  reply	other threads:[~2011-11-02 12:01 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 [this message]
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
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=CAH6eHdTTYj9cD_NVMJXO-v0zEo5ng7es1vaP+HWhdGXHSxL1cA@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).