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 Feb 19, 2020
1 parent b561ca9 commit 43a93a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/itkImageToImageOfVectorsFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ImageToImageOfVectorsFilter<TInputImage, NComponents>::BeforeThreadedGenerateDat

for (unsigned int i = 0; i < NComponents; i++)
{
InputImageType * input = static_cast<InputImageType *>(this->ProcessObject::GetInput(i));
auto * input = static_cast<InputImageType *>(this->ProcessObject::GetInput(i));
if (!input)
{
itkExceptionMacro(<< "Input " << i << " not set!");
Expand Down Expand Up @@ -74,7 +74,7 @@ ImageToImageOfVectorsFilter<TInputImage, NComponents>::DynamicThreadedGenerateDa
typename InputImageType::Pointer inputImagePointer =
static_cast<InputImageType *>(this->ProcessObject::GetInput(i));

InputIteratorType * iit = new InputIteratorType(inputImagePointer, outputRegionForThread);
auto * iit = new InputIteratorType(inputImagePointer, outputRegionForThread);
iit->GoToBegin();
inputItContainer.push_back(iit);
}
Expand Down

0 comments on commit 43a93a5

Please sign in to comment.