rspec/rules/S1045/compliant.adoc

21 lines
318 B
Plaintext

=== Compliant solution
[source,text]
----
class BaseException { };
class DerivedException: public BaseException { };
try
{
// ...
}
catch ( DerivedException &d ) // Compliant
{
// ...
}
catch ( BaseException &b ) // Compliant, will be triggered for BaseException that are not DerivedException
{
// ...
}
----