-
Notifications
You must be signed in to change notification settings - Fork 118
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
Low-risk C++11 and C++14 constexpr functions #177
Conversation
This looks good. Let us run tests. |
Running tests. |
@@ -36,662 +36,663 @@ constexpr static int smallest_power_of_five = binary_format<double>::smallest_po | |||
constexpr static int largest_power_of_five = binary_format<double>::largest_power_of_ten(); | |||
constexpr static int number_of_entries = 2 * (largest_power_of_five - smallest_power_of_five + 1); | |||
// Powers of five from 5^-342 all the way to 5^308 rounded toward one. | |||
static const uint64_t power_of_five_128[number_of_entries]; |
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.
We need to make sure that the large table is included only once per project. I.e., if several compilation units include our header, we want the large table to appear only once in the final executable or library. That is why we use the strange template construction with an unused parameter.
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.
I am not objecting to the PR. I am just raising a flag.
Ok. I am satisfied that it does not obviously create bloating. |
Merged. |
I added
constexpr
to functions where the definitions need no or just minimal change.I added the
FASTFLOAT_CONSTEXPR14
to for functions that need at least C++14 to be markedconstexpr
.