|
|
|
|
|
by pingyong
2292 days ago
|
|
The problem with doing that as a library writer is that exceptions, used well, generally change the entire interface and to some extent programming model. It starts with simple things like returning values instead of an error code (and setting value by reference) and goes through having to make "factory" functions for classes (if you want to use error codes) and ends with all sorts of considerations like copy constructors in C++. So in many cases, if you don't want to compromise on design and architecture, you essentially need to write the entire library twice, or at least the entire interface. Not really a great state. >discussing "Low-cost Deterministic C++ Exceptions for Embedded Systems" This exact reason is why I think that paper is great and also how exceptions should have been implemented in C++ in the first place. |
|