STYLE: Remove this-> on access to private data ResourceProbe#5316
Conversation
Replaced `this->m_` with `m_` in "itkResourceProbe.hxx". Removed parentheses from `++(m_NumberOfStarts)` and `++(m_NumberOfStops)`. Following section "Accessing Members" of ITK's Coding Style Guide, https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/v5.4.3/SoftwareGuide/Latex/Appendices/CodingStyleGuide.tex#L1708
dzenanz
left a comment
There was a problem hiding this comment.
The reason I sometimes had to add this-> was that GCC threw compile errors without it. Hopefully this PR doesn't run into that issue.
@dzenanz Do you remember in what kind of scenario those GCC compile errors appeared? I think it should be OK to just remove the By the way, if it would be access to the non-private data of its base class, I think it would be clearer to do it by |
|
Yes, this issue arises in templated classes (sometimes). You might be completely right. |
Thanks @dzenanz For the sake of completeness, it appears that those GCC compile errors only appear when both the derived and the base class is templated. And the derived tried to access a non-private data member from its base. |
Replaced
this->m_withm_in "itkResourceProbe.hxx". Removed parenthesesfrom
++(m_NumberOfStarts)and++(m_NumberOfStops).Following section "Accessing Members" of ITK's Coding Style Guide