catching std::exception by reference?

后端 未结 4 1049
时光取名叫无心
时光取名叫无心 2021-02-01 05:30

I have a silly question. I read this article about std::exception http://www.cplusplus.com/doc/tutorial/exceptions/

On catch (exception& e), it says:

4条回答
  •  一生所求
    2021-02-01 06:15

    Using reference to exception here can reduce the temporary objects created, and it can also keep the polymorphism.

提交回复
热议问题