The following code complains error C2512: 'MyStruct': no appropriate default constructor available
when trying to compile with MSVC. It works fine with clang
struct MyStruct{
int val;
explicit MyStruct(int v): val(v){}
};
int main()
{
auto ret = std::async([](){MyStruct ms{50}; return ms;});
std::cout << ret.get().val;
return 0;
}
Where does it require in this code to invoke the default constructor?