This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/42819] [C++0x] std::async fails to compile with simple tests, including N3000 example
- From: "jwakely dot gcc at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2010 10:42:35 -0000
- Subject: [Bug libstdc++/42819] [C++0x] std::async fails to compile with simple tests, including N3000 example
- References: <bug-42819-6477@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jwakely dot gcc at gmail dot com 2010-01-21 10:42 -------
(In reply to comment #2)
> Yes, it's a defect (a concepts hangover) - the example is invalid according to
> the async spec. I pointed it out to Lawrence and he's dealing with it for the
> next draft.
To expand on this: std::async is defined in terms of Fn::result_type, assuming
that Concepts would provide Callable::result_type, so the example would be
valid.
Without concepts, that doesn't work, so the example is invalid.
The most likely fix will be to use result_of<Fn(Args...)>::type instead, making
the example valid again.
I chose to follow the spec, not the example which appears in a non-normative
note.
(In reply to comment #4)
> Well, using result_of / decltype would make it more usable in the meanwhile,
> should not be a big deal, right?
Yes, I think we could do that. I'll ask Lawrence how he's planning to address
it - we might as well do that way.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42819