-
-
Notifications
You must be signed in to change notification settings - Fork 269
Open
Description
It looks to me like we could easily replace most conversions from built-in arithmetic types to strings with std::format_to_n() and the corresponding budgeting with std::formatted_size().
Benefits:
- Less dichotomy between integral and floating-point types.
- Ditch complex buffer-budgeting code.
- Trust standard library optimisations over custom cleverness.
- Just maybe get rid of the horrible workarounds for missing floating-point
charconvsupport.
In all honesty, I was quite proud of my trick of writing integer conversions back-to-front in to_buf() and just not caring whether the string would start at the beginning of the buffer. But it's doubtful that I'd be getting much better performance than a good standard-library implementation.
Risks/costs:
- Need to figure out levels of floating-point support from scratch.
- Feels wasteful to have the library parse
"{}"format strings every time. - Missing out on
constexpr.
Metadata
Metadata
Assignees
Labels
No labels