Usage of try/catch blocks in C++

后端 未结 8 2110
有刺的猬
有刺的猬 2020-12-08 12:01

In general, I tend to use try/catch for code which has multiple failure points for which the failures have a common handler.

In my experience, this is typically co

8条回答
  •  温柔的废话
    2020-12-08 12:34

    I found a technical report on C++ performance (pdf warning) that includes a section on exceptions. You might find it interesting. I've had coworkers who believed there was overhead on every instruction within a try/catch block, but this technical report doesn't seem to support that idea.

提交回复
热议问题