When should std::nothrow be used?

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

What is the ideal usage of std::nothrow?

9条回答
  •  感情败类
    2020-12-30 21:16

    I know that there were older versions of C++ (specifically Microsoft's) which did not throw when they could not allocate the memory, but returned NULL instead. This would be an easy way of maintaining compatibility with old code rather than changing all the logic.

提交回复
热议问题