rspec/rules/S1045/compliant.adoc

21 lines
317 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,text]
2020-06-30 12:47:33 +02:00
----
class BaseException { };
class DerivedException: public BaseException { };
try
{
// ...
}
catch ( DerivedException &d ) // Compliant
{
// ...
}
catch ( BaseException &b ) // Compliant, will be triggered for BaseException that are not DerivedException
{
// ...
}
2022-02-04 17:28:24 +01:00
----