...
Noncompliant Code Example (function-try-block)
In this noncompliant This noncompliant code example and , and the following compliant solution, we presume the presumes the existence of a Bad
class class with a destructor that can throw. Although although this class the class violates this rule, we cannot modify it:it is presumed that the class cannot be modified to be conforming.
Code Block | ||||
---|---|---|---|---|
| ||||
// Assume that this class is provided by a 3rd party and it is not something // that can be modified by the user. class Bad { ~Bad() noexcept(false); }; |
...