Coder Social home page Coder Social logo

Comments (2)

lhmouse avatar lhmouse commented on July 17, 2024 1

这条规则可以商榷的地方很多。

  1. 构造异常对象(排除复制构造本身)本身确实可能抛出异常,而且这种情况下会丢失原来的异常上下文。本建议具有事实上的合理性。
  2. 考虑 std::bad_alloc 并未合理地对该异常到底属于逻辑错误还是运行时错误进行归类,尤其是 Linux OOM killer 生效之情形,std::bad_alloc 几乎就完全是由于输入错误导致的(例如 my_string.resize(-1UL))。
  3. what() 应为 noexcept

from safe-rules.

brotherbeer avatar brotherbeer commented on July 17, 2024

收到~ 这个问题确实值得重点强调,ID_exceptionInException 的本意也包含拷贝构造函数,但说得不是很明白,我们下个版本会将这个问题列为单独的一个规则,谢谢~

from safe-rules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.