This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/42819] [C++0x] std::async fails to compile with simple tests, including N3000 example



------- 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


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