Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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
Please
log in
to post a comment.
map_file_mangling
Redeclare with auto
Why is vsnprintf Not Writing the Same Number of Characters as strncpy Would?
Arrays
Insertion vs Sort
RVO hota hai bhenchod
Zero
GetFinalPathNameByHandle Behaviour
hangman
Dices by GOOSE
stackse - search stackoverflow differently
Please log in to post a comment.