Namespaces
Variants
Actions

Talk:cpp/thread/promise/set exception

From cppreference.com
< Talk:cpp‎ | thread‎ | promise

It's not very clear what is supposed to happen when the exception is set to nullptr:

 std::promise<int> p;
 auto f = p.get_future();
 
 p.set_exception(nullptr);
 std::cout << f.get() << std::endl;
that's LWG issue 2276, still on Open status, but the direction appears to make this undefined behavior. libc++ and libstdc++ behave differntly. --Cubbi (talk) 12:44, 3 September 2015 (PDT)