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

For C++17, use range-v3 instead of std::ranges #1667

Merged
merged 51 commits into from
Dec 12, 2024

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Dec 6, 2024

This is a first step towards making QLever compile with C++17.

If the compile-time flag QLEVER_CPP_17 is set, use Eric Niebler's range-v3 library as a drop-in replacement for std::ranges. In the code, we simply write ql::ranges instead of std::ranges in most places. Some places need special treatment. For example, where std::ranges was used as a C++20 concept, we now use the macros CPP_template and CPP_and (also from the range-v3 library), which does the right thing for both C++20 and C++17.

It works so far, but not for IdTables.

Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 95.88138% with 25 lines in your changes missing coverage. Please review.

Project coverage is 89.69%. Comparing base (70964d6) to head (e712d6b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/util/StringUtilsImpl.h 90.00% 0 Missing and 4 partials ⚠️
src/engine/idTable/IdTable.h 87.50% 1 Missing and 2 partials ⚠️
src/engine/sparqlExpressions/SparqlExpression.cpp 25.00% 3 Missing ⚠️
src/util/JoinAlgorithms/JoinAlgorithms.h 90.00% 0 Missing and 3 partials ⚠️
src/engine/QueryPlanner.cpp 95.34% 1 Missing and 1 partial ⚠️
src/engine/idTable/CompressedExternalIdTable.h 85.71% 0 Missing and 2 partials ⚠️
src/util/ChunkedForLoop.h 80.00% 0 Missing and 2 partials ⚠️
src/engine/CartesianProductJoin.cpp 95.00% 0 Missing and 1 partial ⚠️
src/engine/MultiColumnJoin.cpp 50.00% 1 Missing ⚠️
...engine/sparqlExpressions/RelationalExpressions.cpp 85.71% 0 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1667      +/-   ##
==========================================
- Coverage   89.70%   89.69%   -0.01%     
==========================================
  Files         383      385       +2     
  Lines       36962    36955       -7     
  Branches     4178     4179       +1     
==========================================
- Hits        33155    33147       -8     
- Misses       2508     2509       +1     
  Partials     1299     1299              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Next step::
The views.

Signed-off-by: Johannes Kalmbach <[email protected]>
joka921 and others added 20 commits December 10, 2024 12:20
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
(only requires a small change in range-v3 which we can hopefully merge).

Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
TODO<joka921> We have to adapt it.

Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
in the tests.

Signed-off-by: Johannes Kalmbach <[email protected]>
TODO: we do still need a GitHub action for the range-v3 mode.
Signed-off-by: Johannes Kalmbach <[email protected]>
# Conflicts:
#	src/parser/RdfParser.h
Signed-off-by: Johannes Kalmbach <[email protected]>
Signed-off-by: Johannes Kalmbach <[email protected]>
@hannahbast hannahbast marked this pull request as ready for review December 12, 2024 15:01
Copy link
Member

@hannahbast hannahbast left a comment

Choose a reason for hiding this comment

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

1-1 with Johannes, this is awesome, some minor changes left as discussed

@sparql-conformance
Copy link

@hannahbast hannahbast changed the title Allow the usage of range-v3 instead of std::ranges Use range-v3 instead of std::ranges for C++17 Dec 12, 2024
@hannahbast hannahbast changed the title Use range-v3 instead of std::ranges for C++17 For C++17, use range-v3 instead of std::ranges Dec 12, 2024
@hannahbast hannahbast merged commit 4237e0d into ad-freiburg:master Dec 12, 2024
22 checks passed
@joka921 joka921 deleted the backport-range-algorithms-c++17 branch December 18, 2024 09:38
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