-
Notifications
You must be signed in to change notification settings - Fork 60
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
jmcarcell
wants to merge
22
commits into
AIDASoft:master
Choose a base branch
from
jmcarcell:c++20
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
22b9c0a
Require C++20 in podio and ROOT
jmcarcell 5d37d1e
Use consteval when possible and remove checks for C++20
jmcarcell 86f4bee
Add a few more constevals
jmcarcell 0d217dc
Use concepts and simplify templates
jmcarcell 385de71
Change enable_ifs by requires
jmcarcell 525bdf7
Fix the documentation for links
jmcarcell a61d45e
Remove an unused header and use std::disjunction
jmcarcell 2693187
Use algorithms from std::ranges
jmcarcell 5eb39e2
Use std::ranges in a couple more places
jmcarcell d51a4bb
Use concepts when possible and add comments when it's not possible
jmcarcell d65e1ae
Simplify in more places
jmcarcell 9a93f56
Remove dead code
jmcarcell 0ba74a3
Use std::ranges::find
jmcarcell 110efd5
Remove the ubuntu workflow since it is built with C++17
jmcarcell 4c7b7b7
Update docs for the frame
jmcarcell 4415bbc
Fix missing endif
jmcarcell a0f7f84
Add missing is_detected_v
jmcarcell 2f3c035
Fix pre-commit
jmcarcell 5854520
Upper-case the concept collectionType
jmcarcell 2c7917a
Add a minimum ROOT version with support for C++20
jmcarcell 98f2b42
Add back an ubuntu workflow with C++20
jmcarcell 68a3c81
Update the ROOT version
jmcarcell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,18 +194,15 @@ default handle types. This is ensured through `static_assert`s in the | |
`GetDefaultHandleType` helper templates are used to retrieve the correct type | ||
from any `FromT` regardless of whether it is a mutable or a default handle type | ||
With this in mind, effectively all mutating operations on `Link`s are | ||
defined using [*SFINAE*](https://en.cppreference.com/w/cpp/language/sfinae) | ||
using the following template structure (taking here `setFrom` as an example) | ||
defined using the following template structure (taking here `setFrom` as an example) | ||
|
||
```cpp | ||
template <typename FromU, | ||
typename = std::enable_if_t<Mutable && | ||
std::is_same_v<detail::GetDefaultHandleType<FromU>, FromT>>> | ||
void setFrom(FromU value); | ||
template <typename FromU> | ||
requires(Mutable&& std::is_same_v<detail::GetDefaultHandleType<FromU>, FromT>&& | ||
detail::isDefaultHandleType<FromU>) void setFrom(FromU value); | ||
Comment on lines
+200
to
+202
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The formatting here should match the one in the source code |
||
``` | ||
|
||
This is a SFINAE friendly way to ensure that this definition is only viable if | ||
the following conditions are met | ||
Compilation will fail unless the following conditions are met | ||
- The object this method is called on has to be `Mutable`. (first part inside the `std::enable_if`) | ||
- The passed in `value` is either a `Mutable` or default class of type `FromT`. (second part inside the `std::enable_if`) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose gcc11 doesn't yet have enough support for the features that we need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's ROOT being built with C++17 and the check failing, I'm quite sure otherwise it would pass. I think Ubuntu24 will be there soon so maybe we can check in a few days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. In that case we could potentially add an ubuntu workflow based on a key4hep stack?