由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - c++ exception
相关主题
一道编程题 - throw Exceptionsc++问题,请高人指点迷津,c++ faq lite的一个例子
C++: exception: out-of-order execution?一道c++的考古题
请教一个c++ throw exception 问题这段code有啥问题?
C++ 用户定义exception的标准用法是什么?包含指针的类和vector的问题
c++ question回答C++的弱问题
C++ Q15: throw[合集] C++的弱问题
C++ 中 myobject * a =new myobject[n] 的问题急问:compile and build dependency
问个问题--可能比较老find bugs of c++ codes
相关话题的讨论汇总
话题: exception话题: c++话题: throw话题: faq
进入Programming版参与讨论
1 (共1页)
m***t
发帖数: 254
1
i remember c++ faq said only use it in constructor since it is so expensive,
is that generally true?
c******n
发帖数: 145
2
If you mean throw...catch, I think all function should throw an exception
when they cannot fulfill the promises.
I guess what you want to say is the "class invariant"??? It is often called
at the end of the CTOR.
k****f
发帖数: 3794
3
因为构造函数没法返回值的,所以只能用throw/catch
其他函数都可以返回错误信息的。

called

【在 c******n 的大作中提到】
: If you mean throw...catch, I think all function should throw an exception
: when they cannot fulfill the promises.
: I guess what you want to say is the "class invariant"??? It is often called
: at the end of the CTOR.

1 (共1页)
进入Programming版参与讨论
相关主题
find bugs of c++ codesc++ question
C++ questionC++ Q15: throw
vector在constructor里初始化C++ 中 myobject * a =new myobject[n] 的问题
pointer to base class = new derived, what will happend??问个问题--可能比较老
一道编程题 - throw Exceptionsc++问题,请高人指点迷津,c++ faq lite的一个例子
C++: exception: out-of-order execution?一道c++的考古题
请教一个c++ throw exception 问题这段code有啥问题?
C++ 用户定义exception的标准用法是什么?包含指针的类和vector的问题
相关话题的讨论汇总
话题: exception话题: c++话题: throw话题: faq