Skip to content

[GeoMechanicsApplication] Moved function from member to a function in an anonymous namespace#14596

Open
rfaasse wants to merge 1 commit into
masterfrom
geo/fix-clang-tidy-issue
Open

[GeoMechanicsApplication] Moved function from member to a function in an anonymous namespace#14596
rfaasse wants to merge 1 commit into
masterfrom
geo/fix-clang-tidy-issue

Conversation

@rfaasse

@rfaasse rfaasse commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Clang-tidy mentioned this function could be made static. As it would become a private static function (therefore never needed outside of the class and not needing members), it could be moved to a function in an unnamed/anonymous namespace, as per the C++ Core Guidelines

@rfaasse rfaasse self-assigned this Jul 21, 2026
@rfaasse rfaasse added the FastPR This Pr is simple and / or has been already tested and the revision should be fast label Jul 21, 2026
@rfaasse
rfaasse requested a review from a team as a code owner July 21, 2026 14:39

using namespace Kratos;

void CheckElement(Element& rElement, const std::string& rModelPartName, const ProcessInfo& rProcessInfo)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @markelov208, I didn't think about this when reviewing #14581, but I was triggered when I saw the suggestion by clang-tidy to make the function static, as according to the C++ Core Guidelines, it is a good idea to move these kinds of internal functions (that are never needed outside of the source file) to an unnamed namespace instead of having it as a static private function.

@rfaasse
rfaasse requested a review from markelov208 July 21, 2026 14:51

@avdg81 avdg81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Richard,
Thanks a lot for addressing the issue found by clang-tidy. I have no further comments or suggestions.

@rfaasse

rfaasse commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Hi Richard, Thanks a lot for addressing the issue found by clang-tidy. I have no further comments or suggestions.

Thanks for the quick review, I will wait untill Gennady is available to have quick look (it's not that urgent), since it's code that was changed last week in #14581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FastPR This Pr is simple and / or has been already tested and the revision should be fast

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants