Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary inline #694

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

jmcarcell
Copy link
Member

@jmcarcell jmcarcell commented Oct 9, 2024

BEGINRELEASENOTES

  • Remove unnecessary inline in std_interoperability.cpp since the variables are only used in that file.
    ENDRELEASENOTES

@m-fila
Copy link
Contributor

m-fila commented Oct 9, 2024

A constexpr specifier used in an object declaration or non-static member function(until C++14) implies const. A constexpr specifier used in a function or static data member(since C++17) declaration implies inline.

Those are variable declarations so inline isn't implied. Same in key4hep/k4FWCore/pull/248. Was this marked by some linter?

@tmadlener
Copy link
Collaborator

I agree with @m-fila here. On the other hand it shouldn't matter too much in this case since we are not relying on anything that would require them to be inline (i.e. we are not explicitly linking against any of this code, nor are we expecting the variables to have the same address in all translation units).

@jmcarcell
Copy link
Member Author

Yeah inline is not doing anything here, the same object code is produced with and without so it may as well be removed. I'll change the title.

@jmcarcell jmcarcell changed the title Remove redundant inline Remove unnecessary inline Oct 9, 2024
@tmadlener tmadlener merged commit 33a03e1 into AIDASoft:master Oct 15, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants