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

Suggestion: Easier orientation for newbies #219

Open
nigels-com opened this issue Jul 24, 2024 · 2 comments
Open

Suggestion: Easier orientation for newbies #219

nigels-com opened this issue Jul 24, 2024 · 2 comments

Comments

@nigels-com
Copy link

Hello, I came here via the boost mailing list, out of curiosity about the upcoming boost release.

Even though I work on mostly C++20 code bases (how good is that!) I didn't happen to be familar with C++ 17 charconv and it look me to little while to figure out the scope and possible use of boost::charconv. Years ago I got interested in a C++ alternative to iostreams and printf, so there are details here that in indeed familiar, so that helped the penny drop. Definitely the unit tests shed a lot more light for me.

Performance is a recurring issue in the work I do. If boost::charconv (or indeed C++17 charconv) can help me read and write huge CSV files faster, that would be interesting indeed. Generally I use fmt::format as my goto, certainly some performance characterisation would be of interest.

I do appreciate that as developers we tend to focus on the implementation details, and perhaps less on the marketing.

Anyway, best wishes with charconv in boost 1.86.0!

@nigels-com
Copy link
Author

Second question, if I'm already in C++20 do I still need this?

For example we use boost for some things where we want consistency between Windows and Linux, such as random numbers. Often we don't actually care about the wiggle-room in the standards we just want consistency across platforms.

@mborland
Copy link
Member

Hello, I came here via the boost mailing list, out of curiosity about the upcoming boost release.

Even though I work on mostly C++20 code bases (how good is that!) I didn't happen to be familar with C++ 17 charconv and it look me to little while to figure out the scope and possible use of boost::charconv. Years ago I got interested in a C++ alternative to iostreams and printf, so there are details here that in indeed familiar, so that helped the penny drop. Definitely the unit tests shed a lot more light for me.

Performance is a recurring issue in the work I do. If boost::charconv (or indeed C++17 charconv) can help me read and write huge CSV files faster, that would be interesting indeed. Generally I use fmt::format as my goto, certainly some performance characterisation would be of interest.

There's no mechanism to filter out the commas in the CSV but if you pre-parsed and then you can offloaded numeric conversion to charconv. I believe that std::format uses <charconv> in the background so you may see little benefit.

I do appreciate that as developers we tend to focus on the implementation details, and perhaps less on the marketing.

Anyway, best wishes with charconv in boost 1.86.0!

Thank you!

Do you have any particular suggestions on what would have made it easier for you now that you have a grasp on what the library is?

Second question, if I'm already in C++20 do I still need this?
For example we use boost for some things where we want consistency between Windows and Linux, such as random >numbers. Often we don't actually care about the wiggle-room in the standards we just want consistency across platforms.

Depends on your tool chain. Clang doesn't support floating-point operations (I believe it will in 19+), GCC requires 11+, and MSVC requires 19.24+. The standard is pretty strict on numeric conversions so you won't see any real difference in output other than the handling of the different types and signs on NAN.

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

No branches or pull requests

2 participants