-
Notifications
You must be signed in to change notification settings - Fork 59
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
Consistently replace std::ranges
by ql::ranges
#1729
Conversation
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.
Thank you very much for that thorough work!
I only have a single wish remaining, you can see it from the comment.
I am planning to update the range-v3
library s.t. the intefaces for unique
, remove_if
and partition
are consistent, but I like the workarounds you chose .
I think if you quickly update the one change and all the checks run through, then we can merge this soon.
src/engine/CartesianProductJoin.h
Outdated
template <typename R> | ||
requires(ql::ranges::random_access_range<R>) |
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.
Can you put them back into the .cpp
file?
(we prefer the .cpp files wherever feasible, because QLever's compile times are already long enough as they are:)
the
template <typename R> requires(....)
then has to stand before both the declaration in the header and the definition in the implementation file.
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.
Thank you for your feedback. Will address it shortly.
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.
Hi,
Two comments:
-
After an initial review has been done on GitHub please do not rebase/force-push, but rather just add the commits you add. Otherwise the diff on GitHub is broken (I cannot see what has been changed since the last review anymore) which is especially an issue for large PRs.
-
As far as I understand, the
CPP_template
macro doesn't work for separate declaration + definition of a template in C++17 mode.
There are currently two ways around that (for the two functions inCartesianProductJoin
:
- Directly define them in the header (which I have discouraged in the previous review).
- Use the macros in
backports/Concepts.h
that completely disable the concepts in C++17 mode. They should work in this case. So I would suggest (in the header as well as the .cpp file
template <QL_CONCEPT_OR_TYPENAME(ql::ranges::random_access_range) R
IdTable writeAllColumns(R idTables, ....);
With this change, all checks should run through and we can merge this.
Best regards
Johannes
Hello,
BR, |
Thank you, I will wait for the checks to go through and then fix them. Just for some context and information:
But I would prefer a solution that can still do concepts in C++20 mode, but I have to fiddle with the macros a bit. |
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.
One + one final thing
-
For following PRs, please don't use the master branch of your PR, but give it a distinct name. Otherwise it is really hard for other people to locally checkout and play with the PR, as the branch names always collide, which git doesn't like that much.
-
I found the solution for the
CPP_template
thin, and will also shortly update it in the Wiki:
When you have a separater declaration + definition, your write
CPP_template(typename T) (requires something<T>) void f();
And then for the definition (or redeclaration etc.) you use the CPP_template_def
macro, so
CPP_template_def(typename T) (requires something<T>) void f() {....}
.
Can you please add this to the CartesianProductJoin functions (I would have done it myself, but I wasn't motivated to work around the issue of 1.
Best regards
Johannes
Conformance check passed ✅No test result changes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1729 +/- ##
==========================================
+ Coverage 89.90% 89.91% +0.01%
==========================================
Files 393 393
Lines 37479 37620 +141
Branches 4221 4231 +10
==========================================
+ Hits 33694 33826 +132
- Misses 2482 2494 +12
+ Partials 1303 1300 -3 ☔ View full report in Codecov by Sentry. |
std::ranges
by ql::ranges
Quality Gate passedIssues Measures |
When building with
-DUSE_CPP_17_BACKPORT=ON
, thenrange-v3
is used instead ofstd::ranges
in all places (types, functions, concepts).