mercredi 25 mai 2016

Simple std::promise example not working on MSVC

I'm trying to run the example from the cppreference wiki on MSVC 2015, but it always crashes ("abort() has been called") when f3.get() is called, where f3 is the std::future object retrieved from a std::promise. Is this a bug from Visual Studio ?

Here's my Call Stack:

ucrtbased.dll!000007fee5451a05()    Unknown
ucrtbased.dll!000007fee5451ba3()    Unknown
ucrtbased.dll!000007fee5472b7d()    Unknown
ucrtbased.dll!000007fee5471bca()    Unknown
vcruntime140d.dll!000007fef8b84494()    Unknown
vcruntime140d.dll!000007fef8b8651d()    Unknown
vcruntime140d.dll!000007fef8b9714a()    Unknown
ntdll.dll!00000000771e7e8d()    Unknown
ntdll.dll!00000000771d84cf()    Unknown
ntdll.dll!000000007720bac8()    Unknown
KernelBase.dll!000007fefd08a06d()   Unknown
vcruntime140d.dll!000007fef8b881c0()    Unknown
msvcp140d.dll!000007fef01d2ebe()    Unknown
msvcp140d.dll!000007fef01d2e4f()    Unknown
>Sandbox.exe!std::_Check_C_return(int _Res) Line 36 C++
Sandbox.exe!std::_Mtx_lockX(_Mtx_internal_imp_t * _Mtx) Line 71 C++
Sandbox.exe!std::_Mutex_base::lock() Line 44    C++
Sandbox.exe!std::unique_lock<std::mutex>::unique_lock<std::mutex>(std::mutex & _Mtx) Line 274   C++
Sandbox.exe!std::_Associated_state<int>::_Set_exception(std::exception_ptr _Exc, bool _At_thread_exit) Line 414 C++
Sandbox.exe!std::_State_manager<int>::_Set_exception(std::exception_ptr _Exc, bool _Defer) Line 1054    C++
Sandbox.exe!std::promise<int>::~promise<int>() Line 1518    C++
Sandbox.exe!main::__l3::<lambda>(std::promise<int> p) Line 23   C++
[External Code] 

Aucun commentaire:

Enregistrer un commentaire