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

Require C++20 and update to C++20 #698

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

jmcarcell
Copy link
Member

@jmcarcell jmcarcell commented Oct 18, 2024

Since the Key4hep stack and the LCG stack are both on C++20 for some time, we could start using C++20 features. This PR changes the requirements and uses in some places C++20 features.

BEGINRELEASENOTES

  • Simplify template code by using concept and require when possible. In some places like the UserDataCollection and GenericParameters it seems that cppyy (3.1.2 with ROOT 6.32.06) doesn't like requires nor concept so they can't be changed for now.
  • Use consteval when possible which, unlike constexpr, guarantees evaluation at compile-time
  • Remove checks for versions above or below C++20 for the standard
  • Use algorithms from std::ranges like std::ranges::find and std::ranges::sort
  • Remove the ubuntu workflows since they are built on C++17

ENDRELEASENOTES

Copy link
Collaborator

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

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

I am generally very in favor of this. I am not yet entirely sure how to properly reflect this in the podio version. Strictly speaking it could be a breaking change, since we remove a "feature". I think we should at least put some warning / message into a podio tag to check if someone is still building podio with c++17 (and can't easily upgrade to c++20).

We potentially have to change a few of the LCG stacks that we use to have the necessary compiler (and ROOT) support.

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.

2 participants