Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7634749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:15:34+00:00 2026-05-31T07:15:34+00:00

I recently installed the Visual Studio 11 Developer Preview. While playing with threads and

  • 0

I recently installed the Visual Studio 11 Developer Preview. While playing with threads and futures, I came around this setup:

#include <future>
#include <iostream>

int foo(unsigned a, unsigned b)
{
    return 5;
}

int main()
{
    std::future<int> f = std::async(foo, 5, 7);
    std::cout << f.get();
}

So, very simple. But since there are two arguments for “foo”, VS 11 doesn’t want to compile it. (However, g++ does: http://ideone.com/ANrPj) (The runtime error is no problem: std::future exception on gcc experimental implementation of C++0x) (VS 11 errormessage: http://pastebin.com/F9Xunh2s)

I’m a little confused right now, since this error seems extremely obvious to me, even if it is a developer preview. So my questions are:

  • Is this code correct according to the C++11 standard?
  • Is this bug already known/reported?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:15:35+00:00Added an answer on May 31, 2026 at 7:15 am

    Try below adhoc workaround. (I tried at Visual Studio 11 Beta)

    std::future<int> f = std::async(std::launch::any, foo, 5, 7);
    

    As C++11 standards function std::async() has two overloads, but MSVC/CRT can’t do correct overload resolution. Furthermore std::launch::any is NOT a part of standard. (it requires std::launch::async|std::launch::deferred, but they can’t compile again)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was playing around with the idea of using Visual Studio's < include >
I recently installed Visual Studio 2010 Pro. There might have been a link to
I recently installed Visual Studio 2010 Professional RC to try it out and test
I recently installed Visual Studio 2010 (Ultimate edition, final version released in April), and
I recently installed Visual Studio 2010 and copied and converted an old VS2005 solution
Recently I installed in Visual Studio 2010 the Power Tools Extension It's working great,
I recently installed Visual Studio Professional 2010 Beta 1 and noticed that most of
I recently installed Windows 7, then installed Visual Studio 2008. I would like to
Hai guys, I ve formatted my system recently and installed visual studio 2008... I
Recently I installed a Visual Studio 2008 extension called VS.Php, made by Jcx Software:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.