Skip to content

Commit ad0eaca

Browse files
committed
STYLE: Remove redundant typename in type aliases
Refactor code to remove redundant `typename` specifiers in type aliases where unnecessary. Simplifies type definitions for improved readability and consistency while adhering to modern C++ practices. 'typename; is redundant before non-dependent names as of c++17
1 parent 7d89dbc commit ad0eaca

File tree

347 files changed

+793
-854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+793
-854
lines changed

Examples/Filtering/SpatialObjectToImage1.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ main(int argc, char * argv[])
186186
// Software Guide : BeginCodeSnippet
187187
ellipse->SetRadiusInObjectSpace(size[0] * 0.2 * spacing[0]);
188188

189-
typename TubeType::PointType point;
190-
typename TubeType::TubePointType tubePoint;
191-
typename TubeType::TubePointListType tubePointList;
189+
TubeType::PointType point;
190+
TubeType::TubePointType tubePoint;
191+
TubeType::TubePointListType tubePointList;
192192
point[0] = size[0] * 0.2 * spacing[0];
193193
point[1] = size[1] * 0.2 * spacing[1];
194194
point[2] = size[2] * 0.2 * spacing[2];

Examples/Filtering/SpatialObjectToImage3.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,21 +142,21 @@ main(int argc, char * argv[])
142142
// Software Guide : EndLatex
143143

144144
// Software Guide : BeginCodeSnippet
145-
constexpr unsigned int numberOfPoints = 6;
146-
typename PolygonType::PointType point;
147-
typename PolygonType::PointType::VectorType radial;
145+
constexpr unsigned int numberOfPoints = 6;
146+
PolygonType::PointType point;
147+
PolygonType::PointType::VectorType radial;
148148
radial[0] = 0.0;
149149
radial[1] = 0.0;
150150
radial[2] = 0.0;
151151

152-
typename PolygonType::PointType center;
152+
PolygonType::PointType center;
153153
center[0] = 50.0;
154154
center[1] = 50.0;
155155
center[2] = 0.0;
156156

157157
constexpr double radius = 40.0;
158158

159-
typename PolygonType::PolygonPointType polygonPoint;
159+
PolygonType::PolygonPointType polygonPoint;
160160

161161
for (unsigned int i = 0; i < numberOfPoints; ++i)
162162
{

Modules/Core/Common/include/itkAnatomicalOrientation.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ITKCommon_EXPORT AnatomicalOrientation
5454
{
5555
public:
5656
static constexpr unsigned int Dimension = 3;
57-
using DirectionType = typename ImageBase<Dimension>::DirectionType;
57+
using DirectionType = ImageBase<Dimension>::DirectionType;
5858
static constexpr unsigned int ImageDimension = Dimension;
5959

6060
#ifndef ITK_FUTURE_LEGACY_REMOVE
@@ -563,16 +563,16 @@ class ITKCommon_EXPORT AnatomicalOrientation
563563

564564
/** Outputs unambiguous anatomical orientation names such as "right-to-left". */
565565
ITKCommon_EXPORT std::ostream &
566-
operator<<(std::ostream & out, typename AnatomicalOrientation::CoordinateEnum value);
566+
operator<<(std::ostream & out, AnatomicalOrientation::CoordinateEnum value);
567567

568568
/** Outputs the PositiveEnum encoding as a string such as "LPS". */
569569
ITKCommon_EXPORT std::ostream &
570-
operator<<(std::ostream & out, typename AnatomicalOrientation::PositiveEnum value);
570+
operator<<(std::ostream & out, AnatomicalOrientation::PositiveEnum value);
571571

572572

573573
/** Outputs the NegativeEnum encoding as a string such as "RAI" */
574574
ITKCommon_EXPORT std::ostream &
575-
operator<<(std::ostream & out, typename AnatomicalOrientation::NegativeEnum value);
575+
operator<<(std::ostream & out, AnatomicalOrientation::NegativeEnum value);
576576

577577
ITKCommon_EXPORT std::ostream &
578578
operator<<(std::ostream & out, const AnatomicalOrientation & orientation);

Modules/Core/Common/include/itkCompensatedSummation.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ CompensatedSummation<TFloat>::GetSum() const -> const AccumulateType &
142142

143143

144144
template <typename TFloat>
145-
CompensatedSummation<TFloat>::operator typename CompensatedSummation<TFloat>::FloatType() const
145+
CompensatedSummation<TFloat>::operator FloatType() const
146146
{
147147
return this->m_Sum;
148148
}

Modules/Core/Common/include/itkFloodFilledFunctionConditionalConstIterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ITK_TEMPLATE_EXPORT FloodFilledFunctionConditionalConstIterator : public C
5252
using IndexType = typename TImage::IndexType;
5353

5454
/** Index ContainerType */
55-
using SeedsContainerType = typename std::vector<IndexType>;
55+
using SeedsContainerType = std::vector<IndexType>;
5656

5757
/** Size type alias support. */
5858
using SizeType = typename TImage::SizeType;

Modules/Core/Common/include/itkFloodFilledFunctionConditionalConstIterator.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void
105105
FloodFilledFunctionConditionalConstIterator<TImage, TFunction>::FindSeedPixel()
106106
{
107107
// Create an iterator that will walk the input image
108-
using IRIType = typename itk::ImageRegionConstIterator<TImage>;
108+
using IRIType = itk::ImageRegionConstIterator<TImage>;
109109

110110
// Now we search the input image for the first pixel which is inside
111111
// the function of interest

Modules/Core/Common/include/itkImageDuplicator.hxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ ImageDuplicator<TInputImage>::PrintSelf(std::ostream & os, Indent indent) const
6464
itkPrintSelfObjectMacro(InputImage);
6565
itkPrintSelfObjectMacro(DuplicateImage);
6666

67-
os << indent
68-
<< "InternalImageTime: " << static_cast<typename NumericTraits<ModifiedTimeType>::PrintType>(m_InternalImageTime)
67+
os << indent << "InternalImageTime: " << static_cast<NumericTraits<ModifiedTimeType>::PrintType>(m_InternalImageTime)
6968
<< std::endl;
7069
}
7170
} // end namespace itk

Modules/Core/Common/include/itkImageRandomConstIteratorWithIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomConstIteratorWithIndex : public ImageConstI
230230
void
231231
RandomJump();
232232

233-
using GeneratorPointer = typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
233+
using GeneratorPointer = Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
234234
GeneratorPointer m_Generator{ Statistics::MersenneTwisterRandomVariateGenerator::New() };
235235
SizeValueType m_NumberOfSamplesRequested{};
236236
SizeValueType m_NumberOfSamplesDone{};

Modules/Core/Common/include/itkImageRandomConstIteratorWithOnlyIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class ITK_TEMPLATE_EXPORT ImageRandomConstIteratorWithOnlyIndex : public ImageCo
232232
void
233233
RandomJump();
234234

235-
using GeneratorPointer = typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
235+
using GeneratorPointer = Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
236236
GeneratorPointer m_Generator{ Statistics::MersenneTwisterRandomVariateGenerator::New() };
237237
SizeValueType m_NumberOfSamplesRequested{};
238238
SizeValueType m_NumberOfSamplesDone{};

Modules/Core/Common/include/itkImageRandomNonRepeatingConstIteratorWithIndex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NodeOfPermutation
6565
class RandomPermutation
6666
{
6767
public:
68-
using GeneratorPointer = typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
68+
using GeneratorPointer = Statistics::MersenneTwisterRandomVariateGenerator::Pointer;
6969
NodeOfPermutation * m_Permutation;
7070
GeneratorPointer m_Generator;
7171
SizeValueType m_Size;

0 commit comments

Comments
 (0)