Home Dashboard Directory Help
Search

BUG with std::async ? by frank__y


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 742856
Opened: 5/20/2012 7:33:09 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

I want to catch exception from async. Shouldn't get() call wait() internal ? Does i need call wait() explicit before get()?


#include <future>
#include <iostream>
#include <exception>

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    auto f = async( []{throw exception("err") ; });
    try{
        // f.wait(); // Can't catch exception if comment this line. Is it a BUG ???
        f.get();        
    }
    catch(const exception& e){ cout << "catched: " << e.what() << endl; }
    

    cin.get();
    return 0;
}
Details
Sign in to post a comment.
Posted by Microsoft on 5/29/2012 at 8:10 PM
Hi,

Thanks for reporting this bug. We've already fixed it, and the fix will be available in VC11 RTM.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by MS-Moderator10 [Feedback Moderator] on 5/21/2012 at 3:24 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 5/20/2012 at 7:43 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.