Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
throwing an exception containing a unique_ptr is dangerous
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> #include <future> class danger : public std::runtime_error { using runtime_error::runtime_error; std::unique_ptr<int> state_ = std::make_unique<int>(); }; int main() { auto f = std::async([]() { throw danger("hello"); }); try { f.get(); } catch (...) { std::cout << "Double-delete incoming!" << std::endl; } }
run
|
edit
|
history
|
help
0
c++ pure apstraction
Why is vsnprintf Not Writing the Same Number of Characters as strncpy Would?
Temp 1
#21
multiplie linked list numbers
error_code example
Two-phase sample with VC++ 2015
Cannot allocate an array of constant size 0
vaska
Default constructor - deleted