-
Notifications
You must be signed in to change notification settings - Fork 27
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 extended SFINAE capabilities for eckit::Translator #78
Add extended SFINAE capabilities for eckit::Translator #78
Conversation
e80dbf8
to
0c7c3fd
Compare
0c7c3fd
to
4341b14
Compare
4341b14
to
66f2706
Compare
@simondsmart we talked about these changes before. I renamed VariantHelpers to Overloaded. |
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.
After review work today, all approved.
src/eckit/utils/Translator.h
Outdated
|
||
#if __cplusplus >= 201703L | ||
|
||
// primary template handles types that do not support pre-increment: |
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.
This comment is clearly not correct. We are not doing any incrementing here. Pre- or otherwise...
src/eckit/utils/Translator.h
Outdated
} | ||
#else | ||
// If conversion is possible | ||
template <typename F, typename std::enable_if< |
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.
Not sure this enable_if is needed. Probably more useful to just get the compiler error if it doesn't work?
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.
Please fix the mismatched comment that I've already noted, and then merge.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #78 +/- ##
===========================================
- Coverage 62.85% 62.19% -0.66%
===========================================
Files 796 784 -12
Lines 45287 44473 -814
===========================================
- Hits 28463 27661 -802
+ Misses 16824 16812 -12 ☔ View full report in Codecov by Sentry. |
I don't think the tool is correct. The templated lines (https://app.codecov.io/gh/ecmwf/eckit/pull/78?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf#fa32d6530b7a2107fff999390cf9a157-R39) are used by I added a further test that uses it as well |
I added a predicate
IsTranslatable
that test for an existing and valid implementation.Todo so I had to change the default operator to an auto type - otherwise the return type can be deduced without evaluating the overload set properly.
I'm using this in a new multio feature branch with an variant based Metadata class (instead of LocalConfiguration).
The compilation already included mir (develop), metkit and fdb.
Not all of these packages already use C++17. Hence I added some compiler flags.