~/talk

The Many Faces of Number ⟷ String Conversions

Talkat C++ on Sea 2022 · 2022-07-05..07-07· [c-and-cpp]
links:none on file
slides:none on file

Compares concrete APIs (atoi/strtol/sprintf/scanf, std::to_string/stoi, std::stringstream, std::from_chars, fmt/format, scanlib, Boost lexical_cast/convert), implements the same add(string,string)→string with each, and runs benchmarks showing std::from_chars is fastest while std::stringstream is orders of magnitude slower and fmt/format comes close; explains IEEE‑754 shortest unique decimal output and that from_chars gives that; demonstrates a working benchmark and advocates using boost::convert with a from_chars backend (Boost 1.80) for readable, fast conversions.

AI-written summary · about

  1. 0:00Introduction
  2. 0:50Simple calculator demo
  3. 2:14Early C string-to-number
  4. 7:52Number-to-string in C
  5. 11:23printf and scanf
  6. 17:31BSD vs System V strtol
  7. 20:51C++ iostream conversions
  8. 25:11C++11 to_string and stoi
  9. 28:00Floating-point to string challenges
  10. 31:10C++17 charconv
  11. 38:13C++20 fmt and scan
  12. 45:41Benchmarking conversions
  13. 49:17Performance analysis
  14. 49:39Conclusion and future
  15. 51:05Boost libraries
  16. 56:09Boost.Convert overview
  17. 1:01:18Error handling with Boost.Convert
  18. 1:03:47Boost.Convert use
  19. 1:04:09Number-string conversion evolution
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.