3 ms·
> Rust doesn't have recoverable exceptions. Playing devil's advocate: when compiled with panic=unwind, it has. However, the fact that when compiled with panic=
by cesarb 7y ago
> Rust doesn't have recoverable exceptions.
Playing devil's advocate: when compiled with panic=unwind, it has. However, the fact that when compiled with panic=abort they turn into unrecoverable exceptions tends to make the "should it throw exceptions or should it use error codes" choice clear.
- epage 7y agoWe're talking use cases. In Rust, you'd use Result where in C++ you would use exceptions. Panic is equivalent to assert and should not be used where you'd use exceptions in other languages.
- pjmlp 7y agoC++23 might get value type exceptions, and the design is even being discussed across ISO C working group, so that will eventually change.