-
Notifications
You must be signed in to change notification settings - Fork 49
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
Please support fast_float 7.0.0 #135
Comments
The problem is that fast_float doesn't support
The error could be better though. |
Regarding the fast_float::chars_format get_flags() const
{
fast_float::chars_format format_flags{};
if ((m_options & float_reader_base::allow_fixed) != 0) {
format_flags |= fast_float::chars_format::fixed;
}
if ((m_options & float_reader_base::allow_scientific) != 0) {
format_flags |= fast_float::chars_format::scientific;
}
return format_flags;
} |
Yes, that’s much better. Thanks. I failed to notice that |
Technically, this isn’t quite backwards-compatible, because we have changed the type of Trying this with
Hmm. |
Hmm, that makes sense. (See fastfloat/fast_float#88.) What do you think should be done about it? And do you have any idea why it worked before |
The test compiled before because it used the !supported_float overload which in practice is an integer parser. Thank you, I'll add better errors for this. |
Perhaps this then? fast_float::chars_format get_flags() const
{
fast_float::chars_format format_flags{};
if ((m_options & float_reader_base::allow_fixed) != 0) {
format_flags = static_cast<fast_float::chars_format>(format_flags | fast_float::chars_format::fixed);
}
if ((m_options & float_reader_base::allow_scientific) != 0) {
format_flags = static_cast<fast_float::chars_format>(format_flags | fast_float::chars_format::scientific);
}
return format_flags;
} |
That seems to work on both 6.1.6 and 7.0.0! I’m not enough of a C++ language lawyer to explain off the cuff why I’m allowed to bitwise-or two This approach isn’t any simpler than what I originally proposed in #135 (comment), but it has the advantage that we don’t have to explicitly name the underlying type of the |
No. It is not any simpler or faster, the only thing it does is to mention the underlying type.
|
I see that your PR to improve the error message in What do you think we should do about this on the diff --git a/benchmark/runtime/float/repeated.cpp b/benchmark/runtime/float/repeated.cpp
index 0aa0c39..8a4de0a 100644
--- a/benchmark/runtime/float/repeated.cpp
+++ b/benchmark/runtime/float/repeated.cpp
@@ -210,4 +210,3 @@ static void scan_float_repeated_fastfloat(benchmark::State& state)
}
BENCHMARK_TEMPLATE(scan_float_repeated_fastfloat, float);
BENCHMARK_TEMPLATE(scan_float_repeated_fastfloat, double);
-BENCHMARK_TEMPLATE(scan_float_repeated_fastfloat, long double);
diff --git a/benchmark/runtime/float/single.cpp b/benchmark/runtime/float/single.cpp
index e06cd13..6819621 100644
--- a/benchmark/runtime/float/single.cpp
+++ b/benchmark/runtime/float/single.cpp
@@ -185,4 +185,3 @@ static void scan_float_single_fastfloat(benchmark::State& state)
}
BENCHMARK_TEMPLATE(scan_float_single_fastfloat, float);
BENCHMARK_TEMPLATE(scan_float_single_fastfloat, double);
-BENCHMARK_TEMPLATE(scan_float_single_fastfloat, long double); |
Version 7.0.0 of
fast_float
has just been released.One major change is that
char_format
is no longer anenum
, but anenum class
with underlying typeuint64_t
.This requires a bit of adaptation, something like this, which should be backwards-compatible with older
fast_float
releases:However, I still have a problem after making this change:
This error is coming from code that was added in fastfloat/fast_float@0bbba96 as part of fastfloat/fast_float#280, but it’s not immediately clear to me whether this is a regression in
fast_float
or whether it reflects something that ought to be changed inscnlib
.I’ll open a draft PR corresponding to the work described above.
The text was updated successfully, but these errors were encountered: