Repository navigation
STYLE: Remove inline from in-class member functions in "itk*.h" - #7187
Conversation
Thanks @dzenanz It's really a matter of taste, of course. I think it's most common to avoid the |
13614c7 to
43f45c3
Compare
|
I'm fine with this. I like being explicit because I often work with new developers or scientists who aren't experts in C++ nuances. |
Thanks Hans. Unfortunately I think it's a bit difficult to explain the meaning of the For member functions that are defined inside their class definition, the |
[Low impact] The PR changes source spelling across many ITK headers without changing runtime behavior. Restore the missing word before merging to meet the project's source-comment standard. Findings
|
| /** Set the segmentation function. In general, this should only be | ||
| * called by a subclass of this object. It is made public to allow | ||
| * itk::Command objects access. The method is inline to avoid a | ||
| * itk::Command objects access. The method is to avoid a |
There was a problem hiding this comment.
Removing inline here leaves “The method is to avoid a problem,” without saying what avoids it. The project standard requires source comments to explain why the code is written this way. Restore this word: SetSegmentationFunction is still defined in the class and remains implicitly inline.
| * itk::Command objects access. The method is to avoid a | |
| * itk::Command objects access. The method is inline to avoid a |
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
@greptile-apps Addressed by the most recent force-pushed amend, please check!
There was a problem hiding this comment.
Confirmed—the amended revision restores “inline” in the comment at Modules/Segmentation/LevelSets/include/itkSegmentationLevelSetImageFilter.h. It now reads “The method is inline to avoid a problem with the gcc 2.95 compiler matching the declaration with the definition,” so this concern is addressed.
Replaced `^( [^\r\n]*)inline ([^;\\]+\r\n {)` with `$1$2`, using Notepad++ (Search mode: Regular expression).
Member functions that are defined inside their class definition are already implicitly inline, so for these member functions, the `inline` keyword appears redundant.
43f45c3 to
4bdcfcf
Compare
Replaced
^( [^\r\n]*)inline ([^;\\]+\r\n {)with$1$2, using Notepad++ (Search mode: Regular expression).Member functions that are defined inside their class definition are already implicitly inline, so for these member functions, the
inlinekeyword appears redundant.