-
Notifications
You must be signed in to change notification settings - Fork 122
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
Testing of various C++20 features #1207
base: master
Are you sure you want to change the base?
Conversation
Now they DTRT without excessive promotion for ints, doubles, floats, etc...
Barely an improvement and still falls back to Qt if we don't have <bit>, but this is just a proving ground.
The errors actually ARE easier to read. Sure, it's a lot of words in this training-wheels case. gpsbabel/garmin_txt.cc:974:22: error: no matching function for call to 'FahrenheitToCelsius' *temperature = FahrenheitToCelsius("booger"); ^~~~~~~~~~~~~~~~~~~ gpsbabel/defs.h:92:3: note: candidate template ignored: constraints not satisfied [with T = const char *] T FahrenheitToCelsius(T a) { return (a - 32.0) / 1.8;} ^ gpsbabel/defs.h:91:10: note: because 'const char *' does not satisfy 'integral' requires std::integral<T> || std::floating_point<T> ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__concepts/arithmetic.h:30:20: note: because 'is_integral_v<const char *>' evaluated to false concept integral = is_integral_v<_Tp>; ^ gpsbabel/defs.h:91:30: note: and 'const char *' does not satisfy 'floating_point' requires std::integral<T> || std::floating_point<T> ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__concepts/arithmetic.h:39:26: note: because 'is_floating_point_v<const char *>' evaluated to false concept floating_point = is_floating_point_v<_Tp>;
Better type safety from enum class. Less annoying repetition via using.
…enty Why are there merges between mypushes?
fmt.h
Outdated
} ; | ||
|
||
// It's present everywhere else, right? | ||
#elif __has_include(<format.h>) |
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.
The standard header is <format>
, not <format.h>
.
https://en.cppreference.com/w/cpp/header/format
You had a bad merge on xcsv.cc. I think this is what you meant: |
|
||
// Fallback to the system version. | ||
#elif __has_include(<format>) | ||
# include <format.h> |
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.
Again, the system version is<format>
With the xcsv.cc I attached above, and actually including
|
A little bit of everything just to see how well C++20 is supported. This is just
a few commits for each major feature. If there's anything useful in this PR, I expect
to have to pick it apart and cherry pick as I can't imagine this whole PR going in as
one.
See related discussion on #1204.