Skip to content

Commit

Permalink
STYLE: Use auto for variable type matches the type of the initializer…
Browse files Browse the repository at this point in the history
… expression

This check is responsible for using the auto type specifier for variable
declarations to improve code readability and maintainability.

The auto type specifier will only be introduced in situations where the
variable type matches the type of the initializer expression. In other words
auto should deduce the same type that was originally spelled in the source
  • Loading branch information
hjmjohnson committed Mar 1, 2020
1 parent 7a4eb9f commit 19e7161
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/computeDescoteauxBoneEnhancement.cxx
Expand Up @@ -26,7 +26,7 @@ class MyCommand : public itk::Command
{
return;
}
const itk::ProcessObject * processObject = dynamic_cast<const itk::ProcessObject *>(caller);
const auto * processObject = dynamic_cast<const itk::ProcessObject *>(caller);
if (!processObject)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion examples/computeKrcahBoneEnhancement.cxx
Expand Up @@ -27,7 +27,7 @@ class MyCommand : public itk::Command
{
return;
}
const itk::ProcessObject * processObject = dynamic_cast<const itk::ProcessObject *>(caller);
const auto * processObject = dynamic_cast<const itk::ProcessObject *>(caller);
if (!processObject)
{
return;
Expand Down

0 comments on commit 19e7161

Please sign in to comment.