- Hands-On Embedded Programming with C++17
- Maya Posch
- 120字
- 2021-08-20 10:20:47
Exception handling
Exceptions are commonly used on desktop platforms, providing a way to generate exceptions for error conditions, which can be caught and handled in try/catch blocks.
While exception support isn't expensive by itself, an exception being generated is relatively expensive, requiring a significant amount of CPU time and RAM to prepare and handle the exception. You have to also make sure to catch every exception, or risk having the application terminate without clear cause.
Exceptions versus the checking of return code for a method being called is something that has to be decided on a case-by-case basis, and can also be a matter of personal preference. It requires a quite different programming style, which may not work for everyone.
推薦閱讀
- 筆記本電腦使用、維護(hù)與故障排除實戰(zhàn)
- Learning Cocos2d-x Game Development
- 電腦組裝與維修從入門到精通(第2版)
- 電腦組裝、維護(hù)、維修全能一本通(全彩版)
- Manage Partitions with GParted How-to
- Hands-On Machine Learning with C#
- CC2530單片機(jī)技術(shù)與應(yīng)用
- 電腦高級維修及故障排除實戰(zhàn)
- 筆記本電腦維修300問
- 圖解計算機(jī)組裝與維護(hù)
- Hands-On Deep Learning for Images with TensorFlow
- 3D Printing Blueprints
- Istio實戰(zhàn)指南
- 從企業(yè)級開發(fā)到云原生微服務(wù):Spring Boot實戰(zhàn)
- 計算機(jī)組裝與維護(hù)教程