Disabling exceptions in C ++ will lead to undefined behavior according to the current standard?

I often hear that the C ++ exception system can be turned off, since you do not have to pay for what you do not use. If I want to compile my program in C ++ without exception, will this lead to undefined behavior?

+3
source share
2 answers

In the current (and future) C ++ standard, there is no concept of throwing exceptions. So technically yes, this leads to undefined behavior if you ask for language advocates. Realistic implementations try to define reasonable behavior for this popular extension. Consult your documentation.

+10
source

To add to the answer of Howard.

, , , , .

new, , throw std::bad_alloc, . , 0: , new , 0? ?

CLang , , throw try , , , , .

+3

Source: https://habr.com/ru/post/1793474/


All Articles