std::promise where T must be default constructible in Visual Studio 2017?

前端 未结 2 1054
暗喜
暗喜 2021-01-19 07:49

I am trying to compile the following code in Visual Studio 2017:

#include 

int main()
{
    std::promise&         


        
2条回答
  •  醉梦人生
    2021-01-19 08:41

    Looks like it is a known issue in MSVC's standard library implementation. A simpler reproduction scenario:

    #include 
    struct NoDefaultCtor
    {
        NoDefaultCtor() = delete;
    };
    int main() {
        std::promise p;
        return 0;
    }
    

提交回复
热议问题