Skip to content
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 StringToDoubleConverter::StringTo<T> member function templates #158

Merged

Conversation

N-Dekker
Copy link
Contributor

@N-Dekker N-Dekker commented Apr 9, 2021

Allowed users to write generic code more easily, like this (when T is
either float or double):

converter.StringTo<T>(buffer, length, &processed);

Included a unit test, TEST(StringToTemplate).

Fixes issue #157

With help from Florian Loitsch (@floitsch)

@N-Dekker N-Dekker marked this pull request as ready for review April 9, 2021 22:01
@N-Dekker N-Dekker marked this pull request as draft April 10, 2021 08:46
@N-Dekker N-Dekker force-pushed the StringToDoubleConverter-StringTo-template branch from 41d3f37 to 71e59bf Compare April 10, 2021 09:00
@N-Dekker N-Dekker marked this pull request as ready for review April 10, 2021 10:58
Allowed users to write generic code more easily, like this (when `T` is
either `float` or `double`):

    converter.StringTo<T>(buffer, length, &processed);

Included a unit test, `TEST(StringToTemplate)`.

Fixes issue google#157

With help from Florian Loitsch (floitsch)
@N-Dekker N-Dekker force-pushed the StringToDoubleConverter-StringTo-template branch from 71e59bf to 6a55772 Compare April 10, 2021 20:29
Copy link
Collaborator

@floitsch floitsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
thanks!

@floitsch floitsch merged commit eee1a45 into google:master Apr 10, 2021
@N-Dekker
Copy link
Contributor Author

@floitsch Thanks a lot for merging my very first double-conversion pull request, Florian! You're very helpful! (It's actually my second merged PR at github.com/google, as my PR google/googletest#3184 was merged just last month 😃!)

I'm now considering a similar PR for DoubleToStringConverter. A draft is at https://github.com/N-Dekker/double-conversion/tree/DoubleToStringConverter-ToShortestString-overloads I'm interested to hear what you think!

N-Dekker added a commit to N-Dekker/double-conversion that referenced this pull request Apr 11, 2021
Allowed users to write generic code more easily, in cases where the input value is either a double, or a single-precision float.

Included a unit test, `TEST(DoubleToShortestString)`.

Complementary to pull request google#158 commit eee1a45 "Add `StringToDoubleConverter::StringTo<T>` member function templates"
N-Dekker added a commit to N-Dekker/double-conversion that referenced this pull request Apr 11, 2021
Allowed users to write generic code more easily, in cases where the input value is either a double, or a single-precision float.

Included a unit test, `TEST(DoubleToShortestString)`.

Complementary to pull request google#158 commit eee1a45 "Add `StringToDoubleConverter::StringTo<T>` member function templates"
N-Dekker added a commit to N-Dekker/double-conversion that referenced this pull request Aug 16, 2022
Allowed users to write generic code more easily, in cases where the input value is either a double, or a single-precision float.

Included a unit test, `TEST(DoubleToShortestString)`.

Complementary to pull request google#158 commit eee1a45 "Add `StringToDoubleConverter::StringTo<T>` member function templates"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants