rspec/rules/S1045/compliant.adoc

19 lines
302 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
== Compliant Solution
----
class BaseException { };
class DerivedException: public BaseException { };
try
{
// ...
}
catch ( DerivedException &d ) // Compliant
{
// ...
}
catch ( BaseException &b ) // Compliant, will be triggered for BaseException that are not DerivedException
{
// ...
}
----