Skip to content

Commit

Permalink
STYLE: More trailing return types for declarations containing "inline"
Browse files Browse the repository at this point in the history
Did search for return types of template member functions matching the regular
expression `^inline typename (\w+<.+>::)` and manually replaced them with
trailing return types, when possible.

Follow-up to pull request #4026
commit f048a5b "STYLE: Use trailing return type
for declarations containing "inline""
  • Loading branch information
N-Dekker authored and hjmjohnson committed Apr 30, 2023
1 parent c1628d5 commit b3f74ff
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
Expand Up @@ -394,11 +394,11 @@ ContourExtractor2DImageFilter<TInputImage>::GenerateDataForLabels()


template <typename TInputImage>
inline typename ContourExtractor2DImageFilter<TInputImage>::VertexType
inline auto
ContourExtractor2DImageFilter<TInputImage>::InterpolateContourPosition(InputPixelType fromValue,
InputPixelType toValue,
InputIndexType fromIndex,
InputOffsetType toOffset)
InputOffsetType toOffset) -> VertexType
{
// Now calculate the fraction of the way from 'from' to 'to' that the contour
// crosses. Interpolate linearly: y = v0 + (v1 - v0) * x, and solve for the
Expand Down
Expand Up @@ -56,8 +56,7 @@ ImageToListSampleAdaptor<TImage>::Size() const -> InstanceIdentifier
}

template <typename TImage>
inline typename ImageToListSampleAdaptor<TImage>::AbsoluteFrequencyType ImageToListSampleAdaptor<TImage>::GetFrequency(
InstanceIdentifier) const
inline auto ImageToListSampleAdaptor<TImage>::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType
{
if (m_Image.IsNull())
{
Expand Down
Expand Up @@ -45,8 +45,7 @@ JointDomainImageToListSampleAdaptor<TImage>::Size() const -> InstanceIdentifier
}

template <typename TImage>
inline typename JointDomainImageToListSampleAdaptor<TImage>::AbsoluteFrequencyType
JointDomainImageToListSampleAdaptor<TImage>::GetFrequency(InstanceIdentifier) const
inline auto JointDomainImageToListSampleAdaptor<TImage>::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType
{
if (m_Image.IsNull())
{
Expand Down
8 changes: 4 additions & 4 deletions Modules/Numerics/Statistics/include/itkKdTreeGenerator.hxx
Expand Up @@ -113,12 +113,12 @@ KdTreeGenerator<TSample>::GenerateData()
}

template <typename TSample>
inline typename KdTreeGenerator<TSample>::KdTreeNodeType *
inline auto
KdTreeGenerator<TSample>::GenerateNonterminalNode(unsigned int beginIndex,
unsigned int endIndex,
MeasurementVectorType & lowerBound,
MeasurementVectorType & upperBound,
unsigned int level)
unsigned int level) -> KdTreeNodeType *
{
using NodeType = typename KdTreeType::KdTreeNodeType;
MeasurementType dimensionLowerBound;
Expand Down Expand Up @@ -184,12 +184,12 @@ KdTreeGenerator<TSample>::GenerateNonterminalNode(unsigned int beginI
}

template <typename TSample>
inline typename KdTreeGenerator<TSample>::KdTreeNodeType *
inline auto
KdTreeGenerator<TSample>::GenerateTreeLoop(unsigned int beginIndex,
unsigned int endIndex,
MeasurementVectorType & lowerBound,
MeasurementVectorType & upperBound,
unsigned int level)
unsigned int level) -> KdTreeNodeType *
{
if (endIndex - beginIndex <= m_BucketSize)
{
Expand Down
Expand Up @@ -96,8 +96,7 @@ PointSetToListSampleAdaptor<TPointSet>::GetMeasurementVector(InstanceIdentifier
}

template <typename TPointSet>
inline typename PointSetToListSampleAdaptor<TPointSet>::AbsoluteFrequencyType
PointSetToListSampleAdaptor<TPointSet>::GetFrequency(InstanceIdentifier) const
inline auto PointSetToListSampleAdaptor<TPointSet>::GetFrequency(InstanceIdentifier) const -> AbsoluteFrequencyType
{
if (m_PointSet.IsNull())
{
Expand Down
Expand Up @@ -63,8 +63,8 @@ VectorContainerToListSampleAdaptor<TVectorContainer>::GetMeasurementVector(Insta
}

template <typename TVectorContainer>
inline typename VectorContainerToListSampleAdaptor<TVectorContainer>::AbsoluteFrequencyType
VectorContainerToListSampleAdaptor<TVectorContainer>::GetFrequency(InstanceIdentifier) const
inline auto VectorContainerToListSampleAdaptor<TVectorContainer>::GetFrequency(InstanceIdentifier) const
-> AbsoluteFrequencyType
{
if (this->m_VectorContainer.IsNull())
{
Expand Down
Expand Up @@ -32,12 +32,12 @@ WeightedCentroidKdTreeGenerator<TSample>::PrintSelf(std::ostream & os, Indent in
}

template <typename TSample>
inline typename WeightedCentroidKdTreeGenerator<TSample>::KdTreeNodeType *
inline auto
WeightedCentroidKdTreeGenerator<TSample>::GenerateNonterminalNode(unsigned int beginIndex,
unsigned int endIndex,
MeasurementVectorType & lowerBound,
MeasurementVectorType & upperBound,
unsigned int level)
unsigned int level) -> KdTreeNodeType *
{
MeasurementType dimensionLowerBound;
MeasurementType dimensionUpperBound;
Expand Down

0 comments on commit b3f74ff

Please sign in to comment.