开发者

Catching exceptions by value, reference or pointer [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

catch exception by pointer i开发者_运维技巧n C++

What is the best way to catch an exception: by value, reference or pointer and why?


You nearly always want to catch exceptions by (usually const) reference.


By const reference. You can avoid object copying.


You dont want to raise any more exceptions so catching by reference is best


By reference, unless you're doing Windows programming, where exceptions are typically caught by pointer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜