由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Why it's better not to let destructor emit exception?
相关主题
问个C++重新编译的问题C++ online Test 一题
Placement new的一个问题发面经攒rp —— Bloomberg
问个C++题C++ Q:
When do we need user defined destructor?Bloomberg FSD 相关(2)
Two C++ questions from Bloomberg on-site关于singleton 的面试题
问几道老题Nvidia 3rd phone interview and Amazon offer
问一道c++的题M 家电话难题
C++ Q52: (C6)问一个constructor的问题
相关话题的讨论汇总
话题: exception话题: why话题: emit话题: destructor话题: unwinding
进入JobHunting版参与讨论
1 (共1页)
e**c
发帖数: 95
1
seems it's hard to undertand... People say it will cause undefined behavior.
But I don't quite understand... any help?
w****m
发帖数: 146
2
sometimes when exception is thrown in dtor, it will cause stack unwinding
e**c
发帖数: 95
3
stack unwinding is not a bad thing, what do you mean?

【在 w****m 的大作中提到】
: sometimes when exception is thrown in dtor, it will cause stack unwinding
w****m
发帖数: 146
4
Sorry for thr confusion, I should clarify it: If during stack unwinding a
dtor throws an exception and it is not caught and handled, the terminate()
function will be called. So be prepared to catch any potential exception in
dtor
w****m
发帖数: 146
1 (共1页)
进入JobHunting版参与讨论
相关主题
问一个constructor的问题Two C++ questions from Bloomberg on-site
问一个关于c++的很傻的问题,多谢问几道老题
my MS first interview question问一道c++的题
新Qualcomm面经C++ Q52: (C6)
问个C++重新编译的问题C++ online Test 一题
Placement new的一个问题发面经攒rp —— Bloomberg
问个C++题C++ Q:
When do we need user defined destructor?Bloomberg FSD 相关(2)
相关话题的讨论汇总
话题: exception话题: why话题: emit话题: destructor话题: unwinding