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

refactor!: use c++20 concept to define insert function for different types of seed collections #3367

Merged
merged 37 commits into from
Jul 16, 2024

Conversation

CarloVarni
Copy link
Collaborator

@CarloVarni CarloVarni commented Jul 11, 2024

Taking from @CouthuresJeremy 's PR I'm here proposing a possible alternative that would not even be a breaking change (unless I'm missing something). This will use c++20 concepts to define different versions of an insert function that will add a seed to the output collection.

This will work with 'back_insert_operator' (as we currently do) as well as collection that support push_back and/or insert

blocked by

edit: Now this is breaking since we do not support back_insert_operator option anymore

@CarloVarni CarloVarni added this to the next milestone Jul 11, 2024
@CarloVarni CarloVarni requested a review from andiwand July 11, 2024 14:06
@github-actions github-actions bot added Component - Core Affects the Core module Component - Examples Affects the Examples module Seeding Track Finding and removed Component - Examples Affects the Examples module Track Finding labels Jul 11, 2024
@CarloVarni
Copy link
Collaborator Author

CarloVarni commented Jul 11, 2024

@paulgessinger @andiwand @CouthuresJeremy I have provided support also for the non C++20 code without changes to the API (if you do not count the change of typename as such?), so this may be already ok to go.

The seed finder and filter now accept a global reference to the seed container (for the current code that is a std:: back_insert_iterator<std::vector<Seed>>) but you can also pass directly std::vector or std::set or anything else. Provided there is an adequate insert function in Acts/Utilities/Functions.hpp that should work.

Also, the signatures of the insert functions should automatically prohibit rvalues for collections such as std::vector or std::set for the C++20 part.

I'll add some tests to check and verify this. But this is good to be reviewed already, I think.

/cc @pbutti who may be interested in seeding developments

@github-actions github-actions bot added the Component - Documentation Affects the documentation label Jul 11, 2024
@CarloVarni CarloVarni marked this pull request as ready for review July 11, 2024 21:01
@CarloVarni CarloVarni added the 🛑 blocked This item is blocked by another item label Jul 12, 2024
@github-actions github-actions bot added Component - Examples Affects the Examples module Track Finding labels Jul 13, 2024
@github-actions github-actions bot added Infrastructure Changes to build tools, continous integration, ... Event Data Model labels Jul 13, 2024
@github-actions github-actions bot removed Infrastructure Changes to build tools, continous integration, ... Event Data Model labels Jul 14, 2024
@CarloVarni CarloVarni removed the 🛑 blocked This item is blocked by another item label Jul 14, 2024
@CarloVarni CarloVarni changed the title refactor: use c++20 concept to define insert function for different types of seed collections refactor!: use c++20 concept to define insert function for different types of seed collections Jul 15, 2024
Copy link
Member

@paulgessinger paulgessinger left a comment

Choose a reason for hiding this comment

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

Thanks! Let's get this in.

Copy link

sonarcloud bot commented Jul 16, 2024

@kodiakhq kodiakhq bot merged commit 88c1223 into acts-project:main Jul 16, 2024
44 checks passed
@acts-project-service
Copy link
Collaborator

🔴 Athena integration test results [88c1223]

Build job with this PR failed!

Please investigate the build job for the pipeline!

@acts-project-service acts-project-service added the Breaks Athena build This PR breaks the Athena build label Jul 16, 2024
@CarloVarni CarloVarni deleted the DefineConcept branch July 16, 2024 10:50
@paulgessinger paulgessinger modified the milestones: next, v36.0.0 Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaks Athena build This PR breaks the Athena build Component - Core Affects the Core module Component - Documentation Affects the documentation Component - Examples Affects the Examples module Seeding Track Finding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants