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

Add macros QL_CONCEPT_OR_NOTHING and QL_CONCEPT_OR_TEMPLATE #1686

Merged
merged 7 commits into from
Dec 18, 2024

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Dec 16, 2024

The two macros can be used for concepts that improve the semantics and safety of the code, but are not necessary for compilation. They can be dropped or replaced by something simpler when compiling with C++17.

The macro QL_CONCEPT_OR_NOTHING can be used for concepts that can be omitted when compiling with C++17. For example, QL_CONCEPT_OR_NOTHING(std::view) auto x = someFunction().

The macro QL_CONCEPT_OR_TEMPLATE can be used for concepts that can be replaced by typename when compiling with C++17. For example, template <QL_CONCEPT_OR_TYPENAME(ql::same_as<int>) T> void f(){...}.

…17 backports.

Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
# Conflicts:
#	src/util/TypeTraits.h
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.84%. Comparing base (332d8e5) to head (53c701e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1686      +/-   ##
==========================================
- Coverage   89.87%   89.84%   -0.03%     
==========================================
  Files         389      389              
  Lines       37268    37268              
  Branches     4202     4202              
==========================================
- Hits        33493    33485       -8     
- Misses       2478     2482       +4     
- Partials     1297     1301       +4     

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

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, great stuff, some renamed + fixing of include headers left

@hannahbast hannahbast marked this pull request as ready for review December 17, 2024 20:29
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
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.

Minor formatting fix left

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.

Thanks a lot, I will add a description and merge this once everything is green

@hannahbast hannahbast changed the title Port the SameAsAny concept to C++17 Add macros QL_CONCEPT_OR_NOTHING and QL_CONCEPT_OR_TEMPLATE Dec 17, 2024
@sparql-conformance
Copy link

@hannahbast hannahbast merged commit 97c195a into ad-freiburg:master Dec 18, 2024
21 of 22 checks passed
@joka921 joka921 deleted the same-as-any-cpp-17 branch December 18, 2024 09:34
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