When should std::nothrow be used?

后端 未结 9 1590
误落风尘
误落风尘 2020-12-30 20:27

What is the ideal usage of std::nothrow?

9条回答
  •  再見小時候
    2020-12-30 21:32

    Perhaps if your application required nano-optimization and could not allow the overhead of exception handling, then maybe nothrow would be needed.

    Bear in mind that Stroustrup is pretty adamant that the programmer can turn off overhead in C++. (As a caveat though, just because you have the choice doesn't mean you should.)

提交回复
热议问题