-
Notifications
You must be signed in to change notification settings - Fork 57
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
Conversation
…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>
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
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.
1-1 with Johannes, great stuff, some renamed + fixing of include headers left
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
Signed-off-by: Johannes Kalmbach <johannes.kalmbach@gmail.com>
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.
Minor formatting fix left
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.
Thanks a lot, I will add a description and merge this once everything is green
SameAsAny
concept to C++17QL_CONCEPT_OR_NOTHING
and QL_CONCEPT_OR_TEMPLATE
Conformance check passed ✅No test result changes. |
Quality Gate passedIssues Measures |
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 bytypename
when compiling with C++17. For example,template <QL_CONCEPT_OR_TYPENAME(ql::same_as<int>) T> void f(){...}
.