include::../description.adoc[]

== Noncompliant Code Example

----
int example(int i) {
  int result = static_cast<int>(i + 42); // Noncompliant
  return (int) result; // Noncompliant
}
----

== Compliant Solution

----
int example(int i) {
 int result = i + 42;
 return result;
}
----

== Exceptions

In some rare cases, redundant cast might be justifiable. For example, when casting from platform dependant type; your cast might be redundant on one platform but not on the others.

ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]
