3 ms·
exception shall occur in exceptional circumstances because they are costly in C++. A corrupted data file is a good case. exceptions in C++ shall not be used to
by reacweb 9y ago
exception shall occur in exceptional circumstances because they are costly in C++. A corrupted data file is a good case. exceptions in C++ shall not be used to handle and end_of_file.
This programming style is very specific to the language. In another language, exception may be used more widely.
- _pmf_ 9y ago> exception shall occur in exceptional circumstances because they are costly in C++ The upside is that the happy path (without exceptions) can be branch-free (or at least contain fewer branches than equivalent code handling errors), which is beneficial to performance (hot path stays hot).